| ADD alpine-minirootfs-3.23.3-x86_64.tar.gz / # buildkit |
| CMD ["/bin/sh"] |
| ADD file:2c839faea38099d9a83d60c8fe6c1b44e1ac02a41c29738a485640c40555390c in /usr/local/bin/build-shared-extension |
| ARG PHP_VERSION |
| COPY dir:a0e49907c91c17594e87c4a4c23719022611810706b9f17050ec5187becc170a in /php-${PHP_VERSION} |
| WORKDIR /php-${PHP_VERSION} |
| |1 PHP_VERSION=8.5.3 /bin/sh -c --mount=type=cache,sharing=locked,id=package-manager-alpine-3.23,target=/var/cache/apk <<EOF
ln -s /var/cache/apk /etc/apk/cache
build_deps="autoconf
libxml2-dev
build-base"
# shellcheck disable=SC2086
# need to expand string into individual arguments
apk add --update $build_deps || exit 1
# note about "--with-zlib":
# there is an ongoing bug in the php build system producing a semi-broken php
# when --with-zlib is not specified:
# https://gitlab.alpinelinux.org/alpine/aports/-/issues/8299
# https://github.com/php/php-src/pull/4681
PHP_UNAME="$(uname -o -r)" \
PHP_BUILD_SYSTEM='Linux Container' \
PHP_BUILD_PROVIDER='netztechniker.at' \
PHP_BUILD_COMPILER='gcc' \
PHP_BUILD_ARCH='x86_64-alpine-linux-musl' \
CFLAGS='-O2 -pipe -march=x86-64 -mtune=generic -fomit-frame-pointer' \
CXXFLAGS='-O2 -pipe -march=x86-64 -mtune=generic -fomit-frame-pointer' \
EXTENSION_DIR=/usr/lib/php/modules \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--with-config-file-path=/etc/php \
--with-config-file-scan-dir=/etc/php/conf.d \
--localstatedir=/var \
--build=x86_64-alpine-linux-musl \
--host=x86_64-alpine-linux-musl \
--with-layout=GNU \
--with-pic \
--disable-cgi \
--disable-phpdbg \
--disable-short-tags \
--disable-rpath \
--disable-all \
--with-zlib \
--with-libxml \
--with-pear \
--enable-xml \
|| exit 1
make -j"$(nproc)" || exit 1
strip --strip-unneeded \
sapi/cli/php \
|| exit 1
make install || exit 1
make distclean || exit 1
# shellcheck disable=SC2086
# need to expand string into individual arguments
apk del $build_deps || exit 1
unlink /etc/apk/cache |
| ARG PHP_VERSION PIE_VERSION |
| ADD file:04809cfc3f8e949c7e70c969920173320214022fc2e3bc57144ee129344cd52b in /usr/bin/pie |