diff --git a/8.1/alpine3.21/cli/Dockerfile b/8.1/alpine3.21/cli/Dockerfile deleted file mode 100644 index 200facad92..0000000000 --- a/8.1/alpine3.21/cli/Dockerfile +++ /dev/null @@ -1,223 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.21 - -# dependencies required for running "phpize" -# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev dpkg \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkgconf \ - re2c - -# persistent / runtime deps -RUN apk add --no-cache \ - ca-certificates \ - curl \ - openssl \ - tar \ - xz - -# ensure www-data user exists -RUN set -eux; \ - adduser -u 82 -D -S -G www-data www-data -# 82 is the standard uid/gid for "www-data" in Alpine -# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.14-stable -# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable -# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 1777 /var/www/html - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -pie" - -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD - -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - \ - apk del --no-network .fetch-deps - -COPY docker-php-source /usr/local/bin/ - -RUN set -eux; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - argon2-dev \ - coreutils \ - curl-dev \ - gnu-libiconv-dev \ - libsodium-dev \ - libxml2-dev \ - linux-headers \ - oniguruma-dev \ - openssl-dev \ - patch \ - patchutils \ - readline-dev \ - sqlite-dev \ - ; \ - \ -# make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) - rm -vf /usr/include/iconv.h; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ -# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 - PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ - PHP_UNAME='Linux - Docker' \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ -# Apply patches; see https://github.com/docker-library/php/pull/1552 - # https://github.com/php/php-src/issues/11678 - curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ - echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ - patch -p1 < 11678.patch; \ - rm 11678.patch; \ - # https://github.com/php/php-src/issues/14834 - curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ - echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ - filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ - rm 14834.patch; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors instead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# https://github.com/docker-library/php/issues/822 - --with-pic \ - \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-iconv=/usr \ - --with-openssl \ - --with-readline \ - --with-zlib \ - \ -# https://github.com/docker-library/php/pull/1259 - --enable-phpdbg \ - --enable-phpdbg-readline \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-musl' && echo '--without-pcre-jit') \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --no-cache $runDeps; \ - \ - apk del --no-network .build-deps; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ -# smoke test - php --version - -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] -CMD ["php", "-a"] diff --git a/8.1/alpine3.21/fpm/Dockerfile b/8.1/alpine3.21/fpm/Dockerfile deleted file mode 100644 index c8b7e9e9b2..0000000000 --- a/8.1/alpine3.21/fpm/Dockerfile +++ /dev/null @@ -1,279 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.21 - -# dependencies required for running "phpize" -# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev dpkg \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkgconf \ - re2c - -# persistent / runtime deps -RUN apk add --no-cache \ - ca-certificates \ - curl \ - openssl \ - tar \ - xz - -# ensure www-data user exists -RUN set -eux; \ - adduser -u 82 -D -S -G www-data www-data -# 82 is the standard uid/gid for "www-data" in Alpine -# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.14-stable -# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable -# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 1777 /var/www/html - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -pie" - -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD - -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - \ - apk del --no-network .fetch-deps - -COPY docker-php-source /usr/local/bin/ - -RUN set -eux; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - argon2-dev \ - coreutils \ - curl-dev \ - gnu-libiconv-dev \ - libsodium-dev \ - libxml2-dev \ - linux-headers \ - oniguruma-dev \ - openssl-dev \ - patch \ - patchutils \ - readline-dev \ - sqlite-dev \ - ; \ - \ -# make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) - rm -vf /usr/include/iconv.h; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ -# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 - PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ - PHP_UNAME='Linux - Docker' \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ -# Apply patches; see https://github.com/docker-library/php/pull/1552 - # https://github.com/php/php-src/issues/11678 - curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ - echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ - patch -p1 < 11678.patch; \ - rm 11678.patch; \ - # https://github.com/php/php-src/issues/14834 - curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ - echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ - filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ - rm 14834.patch; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors instead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# https://github.com/docker-library/php/issues/822 - --with-pic \ - \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-iconv=/usr \ - --with-openssl \ - --with-readline \ - --with-zlib \ - \ -# https://github.com/bwoebi/phpdbg-docs/issues/1#issuecomment-163872806 ("phpdbg is primarily a CLI debugger, and is not suitable for debugging an fpm stack.") - --disable-phpdbg \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-musl' && echo '--without-pcre-jit') \ - \ - --disable-cgi \ - \ - --enable-fpm \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --no-cache $runDeps; \ - \ - apk del --no-network .build-deps; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ -# smoke test - php --version - -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] -WORKDIR /var/www/html - -RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ - { \ - echo '[global]'; \ - echo 'error_log = /proc/self/fd/2'; \ - echo; echo '; https://github.com/docker-library/php/pull/725#issuecomment-443540114'; echo 'log_limit = 8192'; \ - echo; \ - echo '[www]'; \ - echo '; php-fpm closes STDOUT on startup, so sending logs to /proc/self/fd/1 does not work.'; \ - echo '; https://bugs.php.net/bug.php?id=73886'; \ - echo 'access.log = /proc/self/fd/2'; \ - echo; \ - echo 'clear_env = no'; \ - echo; \ - echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ - echo 'catch_workers_output = yes'; \ - echo 'decorate_workers_output = no'; \ - } | tee php-fpm.d/docker.conf; \ - { \ - echo '[global]'; \ - echo 'daemonize = no'; \ - echo; \ - echo '[www]'; \ - echo 'listen = 9000'; \ - } | tee php-fpm.d/zz-docker.conf; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ - { \ - echo '; https://github.com/docker-library/php/issues/878#issuecomment-938595965'; \ - echo 'fastcgi.logging = Off'; \ - } > "$PHP_INI_DIR/conf.d/docker-fpm.ini" - -# Override stop signal to stop process gracefully -# https://github.com/php/php-src/blob/17baa87faddc2550def3ae7314236826bc1b1398/sapi/fpm/php-fpm.8.in#L163 -STOPSIGNAL SIGQUIT - -EXPOSE 9000 -CMD ["php-fpm"] diff --git a/8.1/alpine3.21/zts/Dockerfile b/8.1/alpine3.21/zts/Dockerfile deleted file mode 100644 index 4de55cf747..0000000000 --- a/8.1/alpine3.21/zts/Dockerfile +++ /dev/null @@ -1,231 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.21 - -# dependencies required for running "phpize" -# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev dpkg \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkgconf \ - re2c - -# persistent / runtime deps -RUN apk add --no-cache \ - ca-certificates \ - curl \ - openssl \ - tar \ - xz - -# ensure www-data user exists -RUN set -eux; \ - adduser -u 82 -D -S -G www-data www-data -# 82 is the standard uid/gid for "www-data" in Alpine -# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.14-stable -# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable -# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 1777 /var/www/html - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -pie" - -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD - -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - \ - apk del --no-network .fetch-deps - -COPY docker-php-source /usr/local/bin/ - -RUN set -eux; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - argon2-dev \ - coreutils \ - curl-dev \ - gnu-libiconv-dev \ - libsodium-dev \ - libxml2-dev \ - linux-headers \ - oniguruma-dev \ - openssl-dev \ - patch \ - patchutils \ - readline-dev \ - sqlite-dev \ - ; \ - \ -# make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) - rm -vf /usr/include/iconv.h; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ -# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 - PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ - PHP_UNAME='Linux - Docker' \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ -# Apply patches; see https://github.com/docker-library/php/pull/1552 - # https://github.com/php/php-src/issues/11678 - curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ - echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ - patch -p1 < 11678.patch; \ - rm 11678.patch; \ - # https://github.com/php/php-src/issues/14834 - curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ - echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ - filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ - rm 14834.patch; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors instead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# https://github.com/docker-library/php/issues/822 - --with-pic \ - \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-iconv=/usr \ - --with-openssl \ - --with-readline \ - --with-zlib \ - \ -# https://github.com/docker-library/php/pull/1259 - --enable-phpdbg \ - --enable-phpdbg-readline \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-musl' && echo '--without-pcre-jit') \ - \ -# https://github.com/docker-library/php/pull/939#issuecomment-730501748 - --enable-embed \ - \ - --enable-zts \ -# https://externals.io/message/118859 - --disable-zend-signals \ - --enable-zend-max-execution-timers \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --no-cache $runDeps; \ - \ - apk del --no-network .build-deps; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ -# smoke test - php --version - -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] -CMD ["php", "-a"] diff --git a/8.1/alpine3.22/cli/Dockerfile b/8.1/alpine3.22/cli/Dockerfile deleted file mode 100644 index c7c517cdfc..0000000000 --- a/8.1/alpine3.22/cli/Dockerfile +++ /dev/null @@ -1,223 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.22 - -# dependencies required for running "phpize" -# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev dpkg \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkgconf \ - re2c - -# persistent / runtime deps -RUN apk add --no-cache \ - ca-certificates \ - curl \ - openssl \ - tar \ - xz - -# ensure www-data user exists -RUN set -eux; \ - adduser -u 82 -D -S -G www-data www-data -# 82 is the standard uid/gid for "www-data" in Alpine -# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.14-stable -# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable -# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 1777 /var/www/html - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -pie" - -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD - -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - \ - apk del --no-network .fetch-deps - -COPY docker-php-source /usr/local/bin/ - -RUN set -eux; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - argon2-dev \ - coreutils \ - curl-dev \ - gnu-libiconv-dev \ - libsodium-dev \ - libxml2-dev \ - linux-headers \ - oniguruma-dev \ - openssl-dev \ - patch \ - patchutils \ - readline-dev \ - sqlite-dev \ - ; \ - \ -# make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) - rm -vf /usr/include/iconv.h; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ -# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 - PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ - PHP_UNAME='Linux - Docker' \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ -# Apply patches; see https://github.com/docker-library/php/pull/1552 - # https://github.com/php/php-src/issues/11678 - curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ - echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ - patch -p1 < 11678.patch; \ - rm 11678.patch; \ - # https://github.com/php/php-src/issues/14834 - curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ - echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ - filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ - rm 14834.patch; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors instead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# https://github.com/docker-library/php/issues/822 - --with-pic \ - \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-iconv=/usr \ - --with-openssl \ - --with-readline \ - --with-zlib \ - \ -# https://github.com/docker-library/php/pull/1259 - --enable-phpdbg \ - --enable-phpdbg-readline \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-musl' && echo '--without-pcre-jit') \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --no-cache $runDeps; \ - \ - apk del --no-network .build-deps; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ -# smoke test - php --version - -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] -CMD ["php", "-a"] diff --git a/8.1/alpine3.22/fpm/Dockerfile b/8.1/alpine3.22/fpm/Dockerfile deleted file mode 100644 index f7b31a9a18..0000000000 --- a/8.1/alpine3.22/fpm/Dockerfile +++ /dev/null @@ -1,279 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.22 - -# dependencies required for running "phpize" -# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev dpkg \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkgconf \ - re2c - -# persistent / runtime deps -RUN apk add --no-cache \ - ca-certificates \ - curl \ - openssl \ - tar \ - xz - -# ensure www-data user exists -RUN set -eux; \ - adduser -u 82 -D -S -G www-data www-data -# 82 is the standard uid/gid for "www-data" in Alpine -# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.14-stable -# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable -# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 1777 /var/www/html - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -pie" - -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD - -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - \ - apk del --no-network .fetch-deps - -COPY docker-php-source /usr/local/bin/ - -RUN set -eux; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - argon2-dev \ - coreutils \ - curl-dev \ - gnu-libiconv-dev \ - libsodium-dev \ - libxml2-dev \ - linux-headers \ - oniguruma-dev \ - openssl-dev \ - patch \ - patchutils \ - readline-dev \ - sqlite-dev \ - ; \ - \ -# make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) - rm -vf /usr/include/iconv.h; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ -# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 - PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ - PHP_UNAME='Linux - Docker' \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ -# Apply patches; see https://github.com/docker-library/php/pull/1552 - # https://github.com/php/php-src/issues/11678 - curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ - echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ - patch -p1 < 11678.patch; \ - rm 11678.patch; \ - # https://github.com/php/php-src/issues/14834 - curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ - echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ - filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ - rm 14834.patch; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors instead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# https://github.com/docker-library/php/issues/822 - --with-pic \ - \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-iconv=/usr \ - --with-openssl \ - --with-readline \ - --with-zlib \ - \ -# https://github.com/bwoebi/phpdbg-docs/issues/1#issuecomment-163872806 ("phpdbg is primarily a CLI debugger, and is not suitable for debugging an fpm stack.") - --disable-phpdbg \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-musl' && echo '--without-pcre-jit') \ - \ - --disable-cgi \ - \ - --enable-fpm \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --no-cache $runDeps; \ - \ - apk del --no-network .build-deps; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ -# smoke test - php --version - -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] -WORKDIR /var/www/html - -RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ - { \ - echo '[global]'; \ - echo 'error_log = /proc/self/fd/2'; \ - echo; echo '; https://github.com/docker-library/php/pull/725#issuecomment-443540114'; echo 'log_limit = 8192'; \ - echo; \ - echo '[www]'; \ - echo '; php-fpm closes STDOUT on startup, so sending logs to /proc/self/fd/1 does not work.'; \ - echo '; https://bugs.php.net/bug.php?id=73886'; \ - echo 'access.log = /proc/self/fd/2'; \ - echo; \ - echo 'clear_env = no'; \ - echo; \ - echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ - echo 'catch_workers_output = yes'; \ - echo 'decorate_workers_output = no'; \ - } | tee php-fpm.d/docker.conf; \ - { \ - echo '[global]'; \ - echo 'daemonize = no'; \ - echo; \ - echo '[www]'; \ - echo 'listen = 9000'; \ - } | tee php-fpm.d/zz-docker.conf; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ - { \ - echo '; https://github.com/docker-library/php/issues/878#issuecomment-938595965'; \ - echo 'fastcgi.logging = Off'; \ - } > "$PHP_INI_DIR/conf.d/docker-fpm.ini" - -# Override stop signal to stop process gracefully -# https://github.com/php/php-src/blob/17baa87faddc2550def3ae7314236826bc1b1398/sapi/fpm/php-fpm.8.in#L163 -STOPSIGNAL SIGQUIT - -EXPOSE 9000 -CMD ["php-fpm"] diff --git a/8.1/alpine3.22/zts/Dockerfile b/8.1/alpine3.22/zts/Dockerfile deleted file mode 100644 index 770f9c7347..0000000000 --- a/8.1/alpine3.22/zts/Dockerfile +++ /dev/null @@ -1,237 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.22 - -# dependencies required for running "phpize" -# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev dpkg \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkgconf \ - re2c - -# persistent / runtime deps -RUN apk add --no-cache \ - ca-certificates \ - curl \ - openssl \ - tar \ - xz - -# ensure www-data user exists -RUN set -eux; \ - adduser -u 82 -D -S -G www-data www-data -# 82 is the standard uid/gid for "www-data" in Alpine -# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.14-stable -# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable -# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 1777 /var/www/html - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -pie" - -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD - -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - \ - apk del --no-network .fetch-deps - -COPY docker-php-source /usr/local/bin/ - -RUN set -eux; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - argon2-dev \ - coreutils \ - curl-dev \ - gnu-libiconv-dev \ - libsodium-dev \ - libxml2-dev \ - linux-headers \ - oniguruma-dev \ - openssl-dev \ - patch \ - patchutils \ - readline-dev \ - sqlite-dev \ - ; \ - \ -# make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) - rm -vf /usr/include/iconv.h; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ -# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 - PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ - PHP_UNAME='Linux - Docker' \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ -# Apply patches; see https://github.com/docker-library/php/pull/1552 - # https://github.com/php/php-src/issues/11678 - curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ - echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ - patch -p1 < 11678.patch; \ - rm 11678.patch; \ - # https://github.com/php/php-src/issues/14834 - curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ - echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ - filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ - rm 14834.patch; \ - # https://github.com/php/php-src/issues/18743 "Incompatibility in Inline TLS Assembly on Alpine 3.22 with zend_jit_ir.c" - # https://github.com/docker-library/php/pull/1580 - curl -fL 'https://github.com/php/php-src/commit/6b105d4bc57e20a2472c9a6ff11fba32768556d4.patch?full_index=1' -o 18743.patch; \ - echo '037e1610ae5d444e9a8c3ecd9d5f0cd215fd0aac90bdd7b9f0b259bffdf3566b *18743.patch' | sha256sum -c -; \ - filterdiff -x '*/NEWS' 18743.patch | patch -p1; \ - rm 18743.patch; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors instead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# https://github.com/docker-library/php/issues/822 - --with-pic \ - \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-iconv=/usr \ - --with-openssl \ - --with-readline \ - --with-zlib \ - \ -# https://github.com/docker-library/php/pull/1259 - --enable-phpdbg \ - --enable-phpdbg-readline \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-musl' && echo '--without-pcre-jit') \ - \ -# https://github.com/docker-library/php/pull/939#issuecomment-730501748 - --enable-embed \ - \ - --enable-zts \ -# https://externals.io/message/118859 - --disable-zend-signals \ - --enable-zend-max-execution-timers \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --no-cache $runDeps; \ - \ - apk del --no-network .build-deps; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ -# smoke test - php --version - -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] -CMD ["php", "-a"] diff --git a/8.1/bookworm/cli/Dockerfile b/8.1/bookworm/cli/Dockerfile deleted file mode 100644 index 006f194ddf..0000000000 --- a/8.1/bookworm/cli/Dockerfile +++ /dev/null @@ -1,230 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM debian:bookworm-slim - -# prevent Debian's PHP packages from being installed -# https://github.com/docker-library/php/pull/542 -RUN set -eux; \ - { \ - echo 'Package: php*'; \ - echo 'Pin: release *'; \ - echo 'Pin-Priority: -1'; \ - } > /etc/apt/preferences.d/no-debian-php - -# dependencies required for running "phpize" -# (see persistent deps below) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkg-config \ - re2c - -# persistent / runtime deps -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - $PHPIZE_DEPS \ - ca-certificates \ - curl \ - xz-utils \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 1777 /var/www/html - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -pie" - -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD - -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends gnupg; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false - -COPY docker-php-source /usr/local/bin/ - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libargon2-dev \ - libcurl4-openssl-dev \ - libonig-dev \ - libreadline-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - zlib1g-dev \ - ; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ -# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 - PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ - PHP_UNAME='Linux - Docker' \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors instead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# https://github.com/docker-library/php/issues/822 - --with-pic \ - \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-iconv \ - --with-openssl \ - --with-readline \ - --with-zlib \ - \ -# https://github.com/docker-library/php/pull/1259 - --enable-phpdbg \ - --enable-phpdbg-readline \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ -# https://github.com/docker-library/php/pull/939#issuecomment-730501748 - --enable-embed \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ - | sort -u \ - | xargs -rt dpkg-query --search \ -# https://manpages.debian.org/trixie/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file) - | awk 'sub(":$", "", $1) { print $1 }' \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ -# smoke test - php --version - -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] -CMD ["php", "-a"] diff --git a/8.1/bookworm/zts/Dockerfile b/8.1/bookworm/zts/Dockerfile deleted file mode 100644 index 73e78be98d..0000000000 --- a/8.1/bookworm/zts/Dockerfile +++ /dev/null @@ -1,235 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM debian:bookworm-slim - -# prevent Debian's PHP packages from being installed -# https://github.com/docker-library/php/pull/542 -RUN set -eux; \ - { \ - echo 'Package: php*'; \ - echo 'Pin: release *'; \ - echo 'Pin-Priority: -1'; \ - } > /etc/apt/preferences.d/no-debian-php - -# dependencies required for running "phpize" -# (see persistent deps below) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkg-config \ - re2c - -# persistent / runtime deps -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - $PHPIZE_DEPS \ - ca-certificates \ - curl \ - xz-utils \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 1777 /var/www/html - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -pie" - -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD - -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends gnupg; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false - -COPY docker-php-source /usr/local/bin/ - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libargon2-dev \ - libcurl4-openssl-dev \ - libonig-dev \ - libreadline-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - zlib1g-dev \ - ; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ -# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 - PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ - PHP_UNAME='Linux - Docker' \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors instead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# https://github.com/docker-library/php/issues/822 - --with-pic \ - \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-iconv \ - --with-openssl \ - --with-readline \ - --with-zlib \ - \ -# https://github.com/docker-library/php/pull/1259 - --enable-phpdbg \ - --enable-phpdbg-readline \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ -# https://github.com/docker-library/php/pull/939#issuecomment-730501748 - --enable-embed \ - \ - --enable-zts \ -# https://externals.io/message/118859 - --disable-zend-signals \ - --enable-zend-max-execution-timers \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ - | sort -u \ - | xargs -rt dpkg-query --search \ -# https://manpages.debian.org/trixie/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file) - | awk 'sub(":$", "", $1) { print $1 }' \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/*; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ -# smoke test - php --version - -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] -CMD ["php", "-a"] diff --git a/8.1/trixie/cli/Dockerfile b/8.1/trixie/cli/Dockerfile deleted file mode 100644 index 0aa7470614..0000000000 --- a/8.1/trixie/cli/Dockerfile +++ /dev/null @@ -1,230 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM debian:trixie-slim - -# prevent Debian's PHP packages from being installed -# https://github.com/docker-library/php/pull/542 -RUN set -eux; \ - { \ - echo 'Package: php*'; \ - echo 'Pin: release *'; \ - echo 'Pin-Priority: -1'; \ - } > /etc/apt/preferences.d/no-debian-php - -# dependencies required for running "phpize" -# (see persistent deps below) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkg-config \ - re2c - -# persistent / runtime deps -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - $PHPIZE_DEPS \ - ca-certificates \ - curl \ - xz-utils \ - ; \ - apt-get dist-clean - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 1777 /var/www/html - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -pie" - -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD - -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends gnupg; \ - apt-get dist-clean; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false - -COPY docker-php-source /usr/local/bin/ - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libargon2-dev \ - libcurl4-openssl-dev \ - libonig-dev \ - libreadline-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - zlib1g-dev \ - ; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ -# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 - PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ - PHP_UNAME='Linux - Docker' \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors instead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# https://github.com/docker-library/php/issues/822 - --with-pic \ - \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-iconv \ - --with-openssl \ - --with-readline \ - --with-zlib \ - \ -# https://github.com/docker-library/php/pull/1259 - --enable-phpdbg \ - --enable-phpdbg-readline \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ -# https://github.com/docker-library/php/pull/939#issuecomment-730501748 - --enable-embed \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ - | sort -u \ - | xargs -rt dpkg-query --search \ -# https://manpages.debian.org/trixie/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file) - | awk 'sub(":$", "", $1) { print $1 }' \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - apt-get dist-clean; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ -# smoke test - php --version - -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] -CMD ["php", "-a"] diff --git a/8.1/trixie/zts/Dockerfile b/8.1/trixie/zts/Dockerfile deleted file mode 100644 index 30e6f4c271..0000000000 --- a/8.1/trixie/zts/Dockerfile +++ /dev/null @@ -1,235 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM debian:trixie-slim - -# prevent Debian's PHP packages from being installed -# https://github.com/docker-library/php/pull/542 -RUN set -eux; \ - { \ - echo 'Package: php*'; \ - echo 'Pin: release *'; \ - echo 'Pin-Priority: -1'; \ - } > /etc/apt/preferences.d/no-debian-php - -# dependencies required for running "phpize" -# (see persistent deps below) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkg-config \ - re2c - -# persistent / runtime deps -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - $PHPIZE_DEPS \ - ca-certificates \ - curl \ - xz-utils \ - ; \ - apt-get dist-clean - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 1777 /var/www/html - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -pie" - -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD - -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends gnupg; \ - apt-get dist-clean; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - \ - curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - \ - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark > /dev/null; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false - -COPY docker-php-source /usr/local/bin/ - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libargon2-dev \ - libcurl4-openssl-dev \ - libonig-dev \ - libreadline-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - zlib1g-dev \ - ; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ -# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 - PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ - PHP_UNAME='Linux - Docker' \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors instead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# https://github.com/docker-library/php/issues/822 - --with-pic \ - \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-iconv \ - --with-openssl \ - --with-readline \ - --with-zlib \ - \ -# https://github.com/docker-library/php/pull/1259 - --enable-phpdbg \ - --enable-phpdbg-readline \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ -# https://github.com/docker-library/php/pull/939#issuecomment-730501748 - --enable-embed \ - \ - --enable-zts \ -# https://externals.io/message/118859 - --disable-zend-signals \ - --enable-zend-max-execution-timers \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find \ - /usr/local \ - -type f \ - -perm '/0111' \ - -exec sh -euxc ' \ - strip --strip-all "$@" || : \ - ' -- '{}' + \ - ; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ - | sort -u \ - | xargs -rt dpkg-query --search \ -# https://manpages.debian.org/trixie/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file) - | awk 'sub(":$", "", $1) { print $1 }' \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - apt-get dist-clean; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ -# smoke test - php --version - -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] -CMD ["php", "-a"] diff --git a/8.2/alpine3.22/cli/Dockerfile b/8.2/alpine3.23/cli/Dockerfile similarity index 89% rename from 8.2/alpine3.22/cli/Dockerfile rename to 8.2/alpine3.23/cli/Dockerfile index be9d0e913b..2cddb8e34e 100644 --- a/8.2/alpine3.22/cli/Dockerfile +++ b/8.2/alpine3.23/cli/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.23 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.1/alpine3.21/cli/docker-php-entrypoint b/8.2/alpine3.23/cli/docker-php-entrypoint similarity index 100% rename from 8.1/alpine3.21/cli/docker-php-entrypoint rename to 8.2/alpine3.23/cli/docker-php-entrypoint diff --git a/8.1/alpine3.21/cli/docker-php-ext-configure b/8.2/alpine3.23/cli/docker-php-ext-configure similarity index 100% rename from 8.1/alpine3.21/cli/docker-php-ext-configure rename to 8.2/alpine3.23/cli/docker-php-ext-configure diff --git a/8.1/alpine3.21/cli/docker-php-ext-enable b/8.2/alpine3.23/cli/docker-php-ext-enable similarity index 100% rename from 8.1/alpine3.21/cli/docker-php-ext-enable rename to 8.2/alpine3.23/cli/docker-php-ext-enable diff --git a/8.1/alpine3.21/cli/docker-php-ext-install b/8.2/alpine3.23/cli/docker-php-ext-install similarity index 100% rename from 8.1/alpine3.21/cli/docker-php-ext-install rename to 8.2/alpine3.23/cli/docker-php-ext-install diff --git a/8.1/alpine3.21/cli/docker-php-source b/8.2/alpine3.23/cli/docker-php-source similarity index 100% rename from 8.1/alpine3.21/cli/docker-php-source rename to 8.2/alpine3.23/cli/docker-php-source diff --git a/8.2/alpine3.22/fpm/Dockerfile b/8.2/alpine3.23/fpm/Dockerfile similarity index 85% rename from 8.2/alpine3.22/fpm/Dockerfile rename to 8.2/alpine3.23/fpm/Dockerfile index 001bc3b3c0..cb8e287746 100644 --- a/8.2/alpine3.22/fpm/Dockerfile +++ b/8.2/alpine3.23/fpm/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.23 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -213,20 +226,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -242,13 +251,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.1/alpine3.21/fpm/docker-php-entrypoint b/8.2/alpine3.23/fpm/docker-php-entrypoint similarity index 100% rename from 8.1/alpine3.21/fpm/docker-php-entrypoint rename to 8.2/alpine3.23/fpm/docker-php-entrypoint diff --git a/8.1/alpine3.21/fpm/docker-php-ext-configure b/8.2/alpine3.23/fpm/docker-php-ext-configure similarity index 100% rename from 8.1/alpine3.21/fpm/docker-php-ext-configure rename to 8.2/alpine3.23/fpm/docker-php-ext-configure diff --git a/8.1/alpine3.21/fpm/docker-php-ext-enable b/8.2/alpine3.23/fpm/docker-php-ext-enable similarity index 100% rename from 8.1/alpine3.21/fpm/docker-php-ext-enable rename to 8.2/alpine3.23/fpm/docker-php-ext-enable diff --git a/8.1/alpine3.21/fpm/docker-php-ext-install b/8.2/alpine3.23/fpm/docker-php-ext-install similarity index 100% rename from 8.1/alpine3.21/fpm/docker-php-ext-install rename to 8.2/alpine3.23/fpm/docker-php-ext-install diff --git a/8.1/alpine3.21/fpm/docker-php-source b/8.2/alpine3.23/fpm/docker-php-source similarity index 100% rename from 8.1/alpine3.21/fpm/docker-php-source rename to 8.2/alpine3.23/fpm/docker-php-source diff --git a/8.2/alpine3.22/zts/Dockerfile b/8.2/alpine3.23/zts/Dockerfile similarity index 90% rename from 8.2/alpine3.22/zts/Dockerfile rename to 8.2/alpine3.23/zts/Dockerfile index 689b9abaec..59c7d666b5 100644 --- a/8.2/alpine3.22/zts/Dockerfile +++ b/8.2/alpine3.23/zts/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.23 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -124,8 +124,21 @@ RUN set -eux; \ filterdiff -x '*/NEWS' 18743.patch | patch -p1; \ rm 18743.patch; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.1/alpine3.21/zts/docker-php-entrypoint b/8.2/alpine3.23/zts/docker-php-entrypoint similarity index 100% rename from 8.1/alpine3.21/zts/docker-php-entrypoint rename to 8.2/alpine3.23/zts/docker-php-entrypoint diff --git a/8.1/alpine3.21/zts/docker-php-ext-configure b/8.2/alpine3.23/zts/docker-php-ext-configure similarity index 100% rename from 8.1/alpine3.21/zts/docker-php-ext-configure rename to 8.2/alpine3.23/zts/docker-php-ext-configure diff --git a/8.1/alpine3.21/zts/docker-php-ext-enable b/8.2/alpine3.23/zts/docker-php-ext-enable similarity index 100% rename from 8.1/alpine3.21/zts/docker-php-ext-enable rename to 8.2/alpine3.23/zts/docker-php-ext-enable diff --git a/8.1/alpine3.21/zts/docker-php-ext-install b/8.2/alpine3.23/zts/docker-php-ext-install similarity index 100% rename from 8.1/alpine3.21/zts/docker-php-ext-install rename to 8.2/alpine3.23/zts/docker-php-ext-install diff --git a/8.1/alpine3.21/zts/docker-php-source b/8.2/alpine3.23/zts/docker-php-source similarity index 100% rename from 8.1/alpine3.21/zts/docker-php-source rename to 8.2/alpine3.23/zts/docker-php-source diff --git a/8.2/alpine3.21/cli/Dockerfile b/8.2/alpine3.24/cli/Dockerfile similarity index 89% rename from 8.2/alpine3.21/cli/Dockerfile rename to 8.2/alpine3.24/cli/Dockerfile index 2686646b33..7bbc89d091 100644 --- a/8.2/alpine3.21/cli/Dockerfile +++ b/8.2/alpine3.24/cli/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.24 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.1/alpine3.22/cli/docker-php-entrypoint b/8.2/alpine3.24/cli/docker-php-entrypoint similarity index 100% rename from 8.1/alpine3.22/cli/docker-php-entrypoint rename to 8.2/alpine3.24/cli/docker-php-entrypoint diff --git a/8.1/alpine3.22/cli/docker-php-ext-configure b/8.2/alpine3.24/cli/docker-php-ext-configure similarity index 100% rename from 8.1/alpine3.22/cli/docker-php-ext-configure rename to 8.2/alpine3.24/cli/docker-php-ext-configure diff --git a/8.1/alpine3.22/cli/docker-php-ext-enable b/8.2/alpine3.24/cli/docker-php-ext-enable similarity index 100% rename from 8.1/alpine3.22/cli/docker-php-ext-enable rename to 8.2/alpine3.24/cli/docker-php-ext-enable diff --git a/8.1/alpine3.22/cli/docker-php-ext-install b/8.2/alpine3.24/cli/docker-php-ext-install similarity index 100% rename from 8.1/alpine3.22/cli/docker-php-ext-install rename to 8.2/alpine3.24/cli/docker-php-ext-install diff --git a/8.1/alpine3.22/cli/docker-php-source b/8.2/alpine3.24/cli/docker-php-source similarity index 100% rename from 8.1/alpine3.22/cli/docker-php-source rename to 8.2/alpine3.24/cli/docker-php-source diff --git a/8.2/alpine3.21/fpm/Dockerfile b/8.2/alpine3.24/fpm/Dockerfile similarity index 85% rename from 8.2/alpine3.21/fpm/Dockerfile rename to 8.2/alpine3.24/fpm/Dockerfile index 2168394feb..aa7d3c7f0e 100644 --- a/8.2/alpine3.21/fpm/Dockerfile +++ b/8.2/alpine3.24/fpm/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.24 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -213,20 +226,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -242,13 +251,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.1/alpine3.22/fpm/docker-php-entrypoint b/8.2/alpine3.24/fpm/docker-php-entrypoint similarity index 100% rename from 8.1/alpine3.22/fpm/docker-php-entrypoint rename to 8.2/alpine3.24/fpm/docker-php-entrypoint diff --git a/8.1/alpine3.22/fpm/docker-php-ext-configure b/8.2/alpine3.24/fpm/docker-php-ext-configure similarity index 100% rename from 8.1/alpine3.22/fpm/docker-php-ext-configure rename to 8.2/alpine3.24/fpm/docker-php-ext-configure diff --git a/8.1/alpine3.22/fpm/docker-php-ext-enable b/8.2/alpine3.24/fpm/docker-php-ext-enable similarity index 100% rename from 8.1/alpine3.22/fpm/docker-php-ext-enable rename to 8.2/alpine3.24/fpm/docker-php-ext-enable diff --git a/8.1/alpine3.22/fpm/docker-php-ext-install b/8.2/alpine3.24/fpm/docker-php-ext-install similarity index 100% rename from 8.1/alpine3.22/fpm/docker-php-ext-install rename to 8.2/alpine3.24/fpm/docker-php-ext-install diff --git a/8.1/alpine3.22/fpm/docker-php-source b/8.2/alpine3.24/fpm/docker-php-source similarity index 100% rename from 8.1/alpine3.22/fpm/docker-php-source rename to 8.2/alpine3.24/fpm/docker-php-source diff --git a/8.2/alpine3.21/zts/Dockerfile b/8.2/alpine3.24/zts/Dockerfile similarity index 84% rename from 8.2/alpine3.21/zts/Dockerfile rename to 8.2/alpine3.24/zts/Dockerfile index ec9d2e5a78..18e4bf5512 100644 --- a/8.2/alpine3.21/zts/Dockerfile +++ b/8.2/alpine3.24/zts/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.24 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -98,6 +98,8 @@ RUN set -eux; \ linux-headers \ oniguruma-dev \ openssl-dev \ + patch \ + patchutils \ readline-dev \ sqlite-dev \ ; \ @@ -115,9 +117,28 @@ RUN set -eux; \ ; \ docker-php-source extract; \ cd /usr/src/php; \ + # https://github.com/php/php-src/issues/18743 "Incompatibility in Inline TLS Assembly on Alpine 3.22 with zend_jit_ir.c" + # https://github.com/docker-library/php/pull/1580 + curl -fL 'https://github.com/php/php-src/commit/b3c8afe272a6919248986c703c2e1defc73ff707.patch?full_index=1' -o 18743.patch; \ + echo 'b334f73434c9732a4b27a42eb5d417e10df842e854c02a3e753b2479f8978bf5 *18743.patch' | sha256sum -c -; \ + filterdiff -x '*/NEWS' 18743.patch | patch -p1; \ + rm 18743.patch; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.1/alpine3.22/zts/docker-php-entrypoint b/8.2/alpine3.24/zts/docker-php-entrypoint similarity index 100% rename from 8.1/alpine3.22/zts/docker-php-entrypoint rename to 8.2/alpine3.24/zts/docker-php-entrypoint diff --git a/8.1/alpine3.22/zts/docker-php-ext-configure b/8.2/alpine3.24/zts/docker-php-ext-configure similarity index 100% rename from 8.1/alpine3.22/zts/docker-php-ext-configure rename to 8.2/alpine3.24/zts/docker-php-ext-configure diff --git a/8.1/alpine3.22/zts/docker-php-ext-enable b/8.2/alpine3.24/zts/docker-php-ext-enable similarity index 100% rename from 8.1/alpine3.22/zts/docker-php-ext-enable rename to 8.2/alpine3.24/zts/docker-php-ext-enable diff --git a/8.1/alpine3.22/zts/docker-php-ext-install b/8.2/alpine3.24/zts/docker-php-ext-install similarity index 100% rename from 8.1/alpine3.22/zts/docker-php-ext-install rename to 8.2/alpine3.24/zts/docker-php-ext-install diff --git a/8.1/alpine3.22/zts/docker-php-source b/8.2/alpine3.24/zts/docker-php-source similarity index 100% rename from 8.1/alpine3.22/zts/docker-php-source rename to 8.2/alpine3.24/zts/docker-php-source diff --git a/8.2/bookworm/apache/Dockerfile b/8.2/bookworm/apache/Dockerfile index 49c85c4c66..3405c6f001 100644 --- a/8.2/bookworm/apache/Dockerfile +++ b/8.2/bookworm/apache/Dockerfile @@ -120,9 +120,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -188,8 +188,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.2/bookworm/cli/Dockerfile b/8.2/bookworm/cli/Dockerfile index 29f7e7b7f0..fd98d5efb3 100644 --- a/8.2/bookworm/cli/Dockerfile +++ b/8.2/bookworm/cli/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.2/bookworm/fpm/Dockerfile b/8.2/bookworm/fpm/Dockerfile index 124f4bef07..aa8667be45 100644 --- a/8.2/bookworm/fpm/Dockerfile +++ b/8.2/bookworm/fpm/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -230,20 +243,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -259,13 +268,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.2/bookworm/zts/Dockerfile b/8.2/bookworm/zts/Dockerfile index 88d124f6e6..a0c1956f4d 100644 --- a/8.2/bookworm/zts/Dockerfile +++ b/8.2/bookworm/zts/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.2/trixie/apache/Dockerfile b/8.2/trixie/apache/Dockerfile index c8b3d92ac3..cf111edc45 100644 --- a/8.2/trixie/apache/Dockerfile +++ b/8.2/trixie/apache/Dockerfile @@ -120,9 +120,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -188,8 +188,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.2/trixie/cli/Dockerfile b/8.2/trixie/cli/Dockerfile index 8d3f55ee0b..4dad48ee50 100644 --- a/8.2/trixie/cli/Dockerfile +++ b/8.2/trixie/cli/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.2/trixie/fpm/Dockerfile b/8.2/trixie/fpm/Dockerfile index 1fc0a9d2a1..3bac6a8d6c 100644 --- a/8.2/trixie/fpm/Dockerfile +++ b/8.2/trixie/fpm/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -230,20 +243,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -259,13 +268,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.2/trixie/zts/Dockerfile b/8.2/trixie/zts/Dockerfile index acbc0c95c1..7703115e82 100644 --- a/8.2/trixie/zts/Dockerfile +++ b/8.2/trixie/zts/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC -ENV PHP_VERSION 8.2.29 -ENV PHP_URL="https://www.php.net/distributions/php-8.2.29.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.29.tar.xz.asc" -ENV PHP_SHA256="475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c" +ENV PHP_VERSION 8.2.36 +ENV PHP_URL="https://www.php.net/distributions/php-8.2.36.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.2.36.tar.xz.asc" +ENV PHP_SHA256="df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.3/alpine3.22/cli/Dockerfile b/8.3/alpine3.23/cli/Dockerfile similarity index 89% rename from 8.3/alpine3.22/cli/Dockerfile rename to 8.3/alpine3.23/cli/Dockerfile index f3c51c9f8f..24e56c0587 100644 --- a/8.3/alpine3.22/cli/Dockerfile +++ b/8.3/alpine3.23/cli/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.23 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.1/bookworm/cli/docker-php-entrypoint b/8.3/alpine3.23/cli/docker-php-entrypoint similarity index 100% rename from 8.1/bookworm/cli/docker-php-entrypoint rename to 8.3/alpine3.23/cli/docker-php-entrypoint diff --git a/8.1/bookworm/apache/docker-php-ext-configure b/8.3/alpine3.23/cli/docker-php-ext-configure similarity index 100% rename from 8.1/bookworm/apache/docker-php-ext-configure rename to 8.3/alpine3.23/cli/docker-php-ext-configure diff --git a/8.1/bookworm/apache/docker-php-ext-enable b/8.3/alpine3.23/cli/docker-php-ext-enable similarity index 100% rename from 8.1/bookworm/apache/docker-php-ext-enable rename to 8.3/alpine3.23/cli/docker-php-ext-enable diff --git a/8.1/bookworm/apache/docker-php-ext-install b/8.3/alpine3.23/cli/docker-php-ext-install similarity index 100% rename from 8.1/bookworm/apache/docker-php-ext-install rename to 8.3/alpine3.23/cli/docker-php-ext-install diff --git a/8.1/bookworm/apache/docker-php-source b/8.3/alpine3.23/cli/docker-php-source similarity index 100% rename from 8.1/bookworm/apache/docker-php-source rename to 8.3/alpine3.23/cli/docker-php-source diff --git a/8.3/alpine3.21/fpm/Dockerfile b/8.3/alpine3.23/fpm/Dockerfile similarity index 85% rename from 8.3/alpine3.21/fpm/Dockerfile rename to 8.3/alpine3.23/fpm/Dockerfile index 39e82a16aa..e815d428bd 100644 --- a/8.3/alpine3.21/fpm/Dockerfile +++ b/8.3/alpine3.23/fpm/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.23 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -209,20 +222,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -238,13 +247,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.1/bookworm/fpm/docker-php-entrypoint b/8.3/alpine3.23/fpm/docker-php-entrypoint similarity index 100% rename from 8.1/bookworm/fpm/docker-php-entrypoint rename to 8.3/alpine3.23/fpm/docker-php-entrypoint diff --git a/8.1/bookworm/cli/docker-php-ext-configure b/8.3/alpine3.23/fpm/docker-php-ext-configure similarity index 100% rename from 8.1/bookworm/cli/docker-php-ext-configure rename to 8.3/alpine3.23/fpm/docker-php-ext-configure diff --git a/8.1/bookworm/cli/docker-php-ext-enable b/8.3/alpine3.23/fpm/docker-php-ext-enable similarity index 100% rename from 8.1/bookworm/cli/docker-php-ext-enable rename to 8.3/alpine3.23/fpm/docker-php-ext-enable diff --git a/8.1/bookworm/cli/docker-php-ext-install b/8.3/alpine3.23/fpm/docker-php-ext-install similarity index 100% rename from 8.1/bookworm/cli/docker-php-ext-install rename to 8.3/alpine3.23/fpm/docker-php-ext-install diff --git a/8.1/bookworm/cli/docker-php-source b/8.3/alpine3.23/fpm/docker-php-source similarity index 100% rename from 8.1/bookworm/cli/docker-php-source rename to 8.3/alpine3.23/fpm/docker-php-source diff --git a/8.3/alpine3.21/zts/Dockerfile b/8.3/alpine3.23/zts/Dockerfile similarity index 89% rename from 8.3/alpine3.21/zts/Dockerfile rename to 8.3/alpine3.23/zts/Dockerfile index f84503c178..a1f19eaf95 100644 --- a/8.3/alpine3.21/zts/Dockerfile +++ b/8.3/alpine3.23/zts/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.23 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.1/bookworm/zts/docker-php-entrypoint b/8.3/alpine3.23/zts/docker-php-entrypoint similarity index 100% rename from 8.1/bookworm/zts/docker-php-entrypoint rename to 8.3/alpine3.23/zts/docker-php-entrypoint diff --git a/8.1/bookworm/fpm/docker-php-ext-configure b/8.3/alpine3.23/zts/docker-php-ext-configure similarity index 100% rename from 8.1/bookworm/fpm/docker-php-ext-configure rename to 8.3/alpine3.23/zts/docker-php-ext-configure diff --git a/8.1/bookworm/fpm/docker-php-ext-enable b/8.3/alpine3.23/zts/docker-php-ext-enable similarity index 100% rename from 8.1/bookworm/fpm/docker-php-ext-enable rename to 8.3/alpine3.23/zts/docker-php-ext-enable diff --git a/8.1/bookworm/fpm/docker-php-ext-install b/8.3/alpine3.23/zts/docker-php-ext-install similarity index 100% rename from 8.1/bookworm/fpm/docker-php-ext-install rename to 8.3/alpine3.23/zts/docker-php-ext-install diff --git a/8.1/bookworm/fpm/docker-php-source b/8.3/alpine3.23/zts/docker-php-source similarity index 100% rename from 8.1/bookworm/fpm/docker-php-source rename to 8.3/alpine3.23/zts/docker-php-source diff --git a/8.3/alpine3.21/cli/Dockerfile b/8.3/alpine3.24/cli/Dockerfile similarity index 89% rename from 8.3/alpine3.21/cli/Dockerfile rename to 8.3/alpine3.24/cli/Dockerfile index 14ef318cac..d59dab829f 100644 --- a/8.3/alpine3.21/cli/Dockerfile +++ b/8.3/alpine3.24/cli/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.24 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.1/trixie/cli/docker-php-entrypoint b/8.3/alpine3.24/cli/docker-php-entrypoint similarity index 100% rename from 8.1/trixie/cli/docker-php-entrypoint rename to 8.3/alpine3.24/cli/docker-php-entrypoint diff --git a/8.1/bookworm/zts/docker-php-ext-configure b/8.3/alpine3.24/cli/docker-php-ext-configure similarity index 100% rename from 8.1/bookworm/zts/docker-php-ext-configure rename to 8.3/alpine3.24/cli/docker-php-ext-configure diff --git a/8.1/bookworm/zts/docker-php-ext-enable b/8.3/alpine3.24/cli/docker-php-ext-enable similarity index 100% rename from 8.1/bookworm/zts/docker-php-ext-enable rename to 8.3/alpine3.24/cli/docker-php-ext-enable diff --git a/8.1/bookworm/zts/docker-php-ext-install b/8.3/alpine3.24/cli/docker-php-ext-install similarity index 100% rename from 8.1/bookworm/zts/docker-php-ext-install rename to 8.3/alpine3.24/cli/docker-php-ext-install diff --git a/8.1/bookworm/zts/docker-php-source b/8.3/alpine3.24/cli/docker-php-source similarity index 100% rename from 8.1/bookworm/zts/docker-php-source rename to 8.3/alpine3.24/cli/docker-php-source diff --git a/8.3/alpine3.22/fpm/Dockerfile b/8.3/alpine3.24/fpm/Dockerfile similarity index 85% rename from 8.3/alpine3.22/fpm/Dockerfile rename to 8.3/alpine3.24/fpm/Dockerfile index 3beeb167d3..b2063739eb 100644 --- a/8.3/alpine3.22/fpm/Dockerfile +++ b/8.3/alpine3.24/fpm/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.24 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -209,20 +222,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -238,13 +247,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.1/trixie/fpm/docker-php-entrypoint b/8.3/alpine3.24/fpm/docker-php-entrypoint similarity index 100% rename from 8.1/trixie/fpm/docker-php-entrypoint rename to 8.3/alpine3.24/fpm/docker-php-entrypoint diff --git a/8.1/trixie/apache/docker-php-ext-configure b/8.3/alpine3.24/fpm/docker-php-ext-configure similarity index 100% rename from 8.1/trixie/apache/docker-php-ext-configure rename to 8.3/alpine3.24/fpm/docker-php-ext-configure diff --git a/8.1/trixie/apache/docker-php-ext-enable b/8.3/alpine3.24/fpm/docker-php-ext-enable similarity index 100% rename from 8.1/trixie/apache/docker-php-ext-enable rename to 8.3/alpine3.24/fpm/docker-php-ext-enable diff --git a/8.1/trixie/apache/docker-php-ext-install b/8.3/alpine3.24/fpm/docker-php-ext-install similarity index 100% rename from 8.1/trixie/apache/docker-php-ext-install rename to 8.3/alpine3.24/fpm/docker-php-ext-install diff --git a/8.1/trixie/apache/docker-php-source b/8.3/alpine3.24/fpm/docker-php-source similarity index 100% rename from 8.1/trixie/apache/docker-php-source rename to 8.3/alpine3.24/fpm/docker-php-source diff --git a/8.3/alpine3.22/zts/Dockerfile b/8.3/alpine3.24/zts/Dockerfile similarity index 89% rename from 8.3/alpine3.22/zts/Dockerfile rename to 8.3/alpine3.24/zts/Dockerfile index acacf65541..66e161c6c6 100644 --- a/8.3/alpine3.22/zts/Dockerfile +++ b/8.3/alpine3.24/zts/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.24 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.1/trixie/zts/docker-php-entrypoint b/8.3/alpine3.24/zts/docker-php-entrypoint similarity index 100% rename from 8.1/trixie/zts/docker-php-entrypoint rename to 8.3/alpine3.24/zts/docker-php-entrypoint diff --git a/8.1/trixie/cli/docker-php-ext-configure b/8.3/alpine3.24/zts/docker-php-ext-configure similarity index 100% rename from 8.1/trixie/cli/docker-php-ext-configure rename to 8.3/alpine3.24/zts/docker-php-ext-configure diff --git a/8.1/trixie/cli/docker-php-ext-enable b/8.3/alpine3.24/zts/docker-php-ext-enable similarity index 100% rename from 8.1/trixie/cli/docker-php-ext-enable rename to 8.3/alpine3.24/zts/docker-php-ext-enable diff --git a/8.1/trixie/cli/docker-php-ext-install b/8.3/alpine3.24/zts/docker-php-ext-install similarity index 100% rename from 8.1/trixie/cli/docker-php-ext-install rename to 8.3/alpine3.24/zts/docker-php-ext-install diff --git a/8.1/trixie/cli/docker-php-source b/8.3/alpine3.24/zts/docker-php-source similarity index 100% rename from 8.1/trixie/cli/docker-php-source rename to 8.3/alpine3.24/zts/docker-php-source diff --git a/8.3/bookworm/apache/Dockerfile b/8.3/bookworm/apache/Dockerfile index d5a2c58986..5786826365 100644 --- a/8.3/bookworm/apache/Dockerfile +++ b/8.3/bookworm/apache/Dockerfile @@ -120,9 +120,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -188,8 +188,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.3/bookworm/cli/Dockerfile b/8.3/bookworm/cli/Dockerfile index 70fea8797e..6ef7935fca 100644 --- a/8.3/bookworm/cli/Dockerfile +++ b/8.3/bookworm/cli/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.3/bookworm/fpm/Dockerfile b/8.3/bookworm/fpm/Dockerfile index 0e49ee7e48..c68e14393b 100644 --- a/8.3/bookworm/fpm/Dockerfile +++ b/8.3/bookworm/fpm/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -226,20 +239,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -255,13 +264,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.3/bookworm/zts/Dockerfile b/8.3/bookworm/zts/Dockerfile index b689a4ed7e..4252361aa1 100644 --- a/8.3/bookworm/zts/Dockerfile +++ b/8.3/bookworm/zts/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.3/trixie/apache/Dockerfile b/8.3/trixie/apache/Dockerfile index e79e1220e6..a99ff0b4ba 100644 --- a/8.3/trixie/apache/Dockerfile +++ b/8.3/trixie/apache/Dockerfile @@ -120,9 +120,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -188,8 +188,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.3/trixie/cli/Dockerfile b/8.3/trixie/cli/Dockerfile index 623bb09721..c546fe84e6 100644 --- a/8.3/trixie/cli/Dockerfile +++ b/8.3/trixie/cli/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.3/trixie/fpm/Dockerfile b/8.3/trixie/fpm/Dockerfile index f0cd9c9246..317fe2d693 100644 --- a/8.3/trixie/fpm/Dockerfile +++ b/8.3/trixie/fpm/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -226,20 +239,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -255,13 +264,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.3/trixie/zts/Dockerfile b/8.3/trixie/zts/Dockerfile index 934c341f02..23d5093f9b 100644 --- a/8.3/trixie/zts/Dockerfile +++ b/8.3/trixie/zts/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA -ENV PHP_VERSION 8.3.24 -ENV PHP_URL="https://www.php.net/distributions/php-8.3.24.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.24.tar.xz.asc" -ENV PHP_SHA256="388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251" +ENV PHP_VERSION 8.3.37 +ENV PHP_URL="https://www.php.net/distributions/php-8.3.37.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.3.37.tar.xz.asc" +ENV PHP_SHA256="0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.4/alpine3.21/cli/Dockerfile b/8.4/alpine3.23/cli/Dockerfile similarity index 89% rename from 8.4/alpine3.21/cli/Dockerfile rename to 8.4/alpine3.23/cli/Dockerfile index ac4f92d1a5..68467e62be 100644 --- a/8.4/alpine3.21/cli/Dockerfile +++ b/8.4/alpine3.23/cli/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.23 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.2/alpine3.21/cli/docker-php-entrypoint b/8.4/alpine3.23/cli/docker-php-entrypoint similarity index 100% rename from 8.2/alpine3.21/cli/docker-php-entrypoint rename to 8.4/alpine3.23/cli/docker-php-entrypoint diff --git a/8.1/trixie/fpm/docker-php-ext-configure b/8.4/alpine3.23/cli/docker-php-ext-configure similarity index 100% rename from 8.1/trixie/fpm/docker-php-ext-configure rename to 8.4/alpine3.23/cli/docker-php-ext-configure diff --git a/8.1/trixie/fpm/docker-php-ext-enable b/8.4/alpine3.23/cli/docker-php-ext-enable similarity index 100% rename from 8.1/trixie/fpm/docker-php-ext-enable rename to 8.4/alpine3.23/cli/docker-php-ext-enable diff --git a/8.1/trixie/fpm/docker-php-ext-install b/8.4/alpine3.23/cli/docker-php-ext-install similarity index 100% rename from 8.1/trixie/fpm/docker-php-ext-install rename to 8.4/alpine3.23/cli/docker-php-ext-install diff --git a/8.1/trixie/fpm/docker-php-source b/8.4/alpine3.23/cli/docker-php-source similarity index 100% rename from 8.1/trixie/fpm/docker-php-source rename to 8.4/alpine3.23/cli/docker-php-source diff --git a/8.4/alpine3.21/fpm/Dockerfile b/8.4/alpine3.23/fpm/Dockerfile similarity index 85% rename from 8.4/alpine3.21/fpm/Dockerfile rename to 8.4/alpine3.23/fpm/Dockerfile index 58c1bf00f5..b6c8eb90e8 100644 --- a/8.4/alpine3.21/fpm/Dockerfile +++ b/8.4/alpine3.23/fpm/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.23 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -209,20 +222,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -238,13 +247,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.2/alpine3.21/fpm/docker-php-entrypoint b/8.4/alpine3.23/fpm/docker-php-entrypoint similarity index 100% rename from 8.2/alpine3.21/fpm/docker-php-entrypoint rename to 8.4/alpine3.23/fpm/docker-php-entrypoint diff --git a/8.1/trixie/zts/docker-php-ext-configure b/8.4/alpine3.23/fpm/docker-php-ext-configure similarity index 100% rename from 8.1/trixie/zts/docker-php-ext-configure rename to 8.4/alpine3.23/fpm/docker-php-ext-configure diff --git a/8.1/trixie/zts/docker-php-ext-enable b/8.4/alpine3.23/fpm/docker-php-ext-enable similarity index 100% rename from 8.1/trixie/zts/docker-php-ext-enable rename to 8.4/alpine3.23/fpm/docker-php-ext-enable diff --git a/8.1/trixie/zts/docker-php-ext-install b/8.4/alpine3.23/fpm/docker-php-ext-install similarity index 100% rename from 8.1/trixie/zts/docker-php-ext-install rename to 8.4/alpine3.23/fpm/docker-php-ext-install diff --git a/8.1/trixie/zts/docker-php-source b/8.4/alpine3.23/fpm/docker-php-source similarity index 100% rename from 8.1/trixie/zts/docker-php-source rename to 8.4/alpine3.23/fpm/docker-php-source diff --git a/8.4/alpine3.22/zts/Dockerfile b/8.4/alpine3.23/zts/Dockerfile similarity index 89% rename from 8.4/alpine3.22/zts/Dockerfile rename to 8.4/alpine3.23/zts/Dockerfile index e810257614..4786f0fcb4 100644 --- a/8.4/alpine3.22/zts/Dockerfile +++ b/8.4/alpine3.23/zts/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.23 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.2/alpine3.21/zts/docker-php-entrypoint b/8.4/alpine3.23/zts/docker-php-entrypoint similarity index 100% rename from 8.2/alpine3.21/zts/docker-php-entrypoint rename to 8.4/alpine3.23/zts/docker-php-entrypoint diff --git a/8.2/alpine3.21/cli/docker-php-ext-configure b/8.4/alpine3.23/zts/docker-php-ext-configure similarity index 100% rename from 8.2/alpine3.21/cli/docker-php-ext-configure rename to 8.4/alpine3.23/zts/docker-php-ext-configure diff --git a/8.2/alpine3.21/cli/docker-php-ext-enable b/8.4/alpine3.23/zts/docker-php-ext-enable similarity index 100% rename from 8.2/alpine3.21/cli/docker-php-ext-enable rename to 8.4/alpine3.23/zts/docker-php-ext-enable diff --git a/8.2/alpine3.21/cli/docker-php-ext-install b/8.4/alpine3.23/zts/docker-php-ext-install similarity index 100% rename from 8.2/alpine3.21/cli/docker-php-ext-install rename to 8.4/alpine3.23/zts/docker-php-ext-install diff --git a/8.2/alpine3.21/cli/docker-php-source b/8.4/alpine3.23/zts/docker-php-source similarity index 100% rename from 8.2/alpine3.21/cli/docker-php-source rename to 8.4/alpine3.23/zts/docker-php-source diff --git a/8.4/alpine3.22/cli/Dockerfile b/8.4/alpine3.24/cli/Dockerfile similarity index 89% rename from 8.4/alpine3.22/cli/Dockerfile rename to 8.4/alpine3.24/cli/Dockerfile index ac080dd5f6..3e8a44a8c8 100644 --- a/8.4/alpine3.22/cli/Dockerfile +++ b/8.4/alpine3.24/cli/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.24 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.2/alpine3.22/cli/docker-php-entrypoint b/8.4/alpine3.24/cli/docker-php-entrypoint similarity index 100% rename from 8.2/alpine3.22/cli/docker-php-entrypoint rename to 8.4/alpine3.24/cli/docker-php-entrypoint diff --git a/8.2/alpine3.21/fpm/docker-php-ext-configure b/8.4/alpine3.24/cli/docker-php-ext-configure similarity index 100% rename from 8.2/alpine3.21/fpm/docker-php-ext-configure rename to 8.4/alpine3.24/cli/docker-php-ext-configure diff --git a/8.2/alpine3.21/fpm/docker-php-ext-enable b/8.4/alpine3.24/cli/docker-php-ext-enable similarity index 100% rename from 8.2/alpine3.21/fpm/docker-php-ext-enable rename to 8.4/alpine3.24/cli/docker-php-ext-enable diff --git a/8.2/alpine3.21/fpm/docker-php-ext-install b/8.4/alpine3.24/cli/docker-php-ext-install similarity index 100% rename from 8.2/alpine3.21/fpm/docker-php-ext-install rename to 8.4/alpine3.24/cli/docker-php-ext-install diff --git a/8.2/alpine3.21/fpm/docker-php-source b/8.4/alpine3.24/cli/docker-php-source similarity index 100% rename from 8.2/alpine3.21/fpm/docker-php-source rename to 8.4/alpine3.24/cli/docker-php-source diff --git a/8.4/alpine3.22/fpm/Dockerfile b/8.4/alpine3.24/fpm/Dockerfile similarity index 85% rename from 8.4/alpine3.22/fpm/Dockerfile rename to 8.4/alpine3.24/fpm/Dockerfile index ece719856d..711c0ec11a 100644 --- a/8.4/alpine3.22/fpm/Dockerfile +++ b/8.4/alpine3.24/fpm/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.24 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -209,20 +222,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -238,13 +247,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.2/alpine3.22/fpm/docker-php-entrypoint b/8.4/alpine3.24/fpm/docker-php-entrypoint similarity index 100% rename from 8.2/alpine3.22/fpm/docker-php-entrypoint rename to 8.4/alpine3.24/fpm/docker-php-entrypoint diff --git a/8.2/alpine3.21/zts/docker-php-ext-configure b/8.4/alpine3.24/fpm/docker-php-ext-configure similarity index 100% rename from 8.2/alpine3.21/zts/docker-php-ext-configure rename to 8.4/alpine3.24/fpm/docker-php-ext-configure diff --git a/8.2/alpine3.21/zts/docker-php-ext-enable b/8.4/alpine3.24/fpm/docker-php-ext-enable similarity index 100% rename from 8.2/alpine3.21/zts/docker-php-ext-enable rename to 8.4/alpine3.24/fpm/docker-php-ext-enable diff --git a/8.2/alpine3.21/zts/docker-php-ext-install b/8.4/alpine3.24/fpm/docker-php-ext-install similarity index 100% rename from 8.2/alpine3.21/zts/docker-php-ext-install rename to 8.4/alpine3.24/fpm/docker-php-ext-install diff --git a/8.2/alpine3.21/zts/docker-php-source b/8.4/alpine3.24/fpm/docker-php-source similarity index 100% rename from 8.2/alpine3.21/zts/docker-php-source rename to 8.4/alpine3.24/fpm/docker-php-source diff --git a/8.4/alpine3.21/zts/Dockerfile b/8.4/alpine3.24/zts/Dockerfile similarity index 89% rename from 8.4/alpine3.21/zts/Dockerfile rename to 8.4/alpine3.24/zts/Dockerfile index 24b36277c4..799cce3dfe 100644 --- a/8.4/alpine3.21/zts/Dockerfile +++ b/8.4/alpine3.24/zts/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.24 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.2/alpine3.22/zts/docker-php-entrypoint b/8.4/alpine3.24/zts/docker-php-entrypoint similarity index 100% rename from 8.2/alpine3.22/zts/docker-php-entrypoint rename to 8.4/alpine3.24/zts/docker-php-entrypoint diff --git a/8.2/alpine3.22/cli/docker-php-ext-configure b/8.4/alpine3.24/zts/docker-php-ext-configure similarity index 100% rename from 8.2/alpine3.22/cli/docker-php-ext-configure rename to 8.4/alpine3.24/zts/docker-php-ext-configure diff --git a/8.2/alpine3.22/cli/docker-php-ext-enable b/8.4/alpine3.24/zts/docker-php-ext-enable similarity index 100% rename from 8.2/alpine3.22/cli/docker-php-ext-enable rename to 8.4/alpine3.24/zts/docker-php-ext-enable diff --git a/8.2/alpine3.22/cli/docker-php-ext-install b/8.4/alpine3.24/zts/docker-php-ext-install similarity index 100% rename from 8.2/alpine3.22/cli/docker-php-ext-install rename to 8.4/alpine3.24/zts/docker-php-ext-install diff --git a/8.2/alpine3.22/cli/docker-php-source b/8.4/alpine3.24/zts/docker-php-source similarity index 100% rename from 8.2/alpine3.22/cli/docker-php-source rename to 8.4/alpine3.24/zts/docker-php-source diff --git a/8.4/bookworm/apache/Dockerfile b/8.4/bookworm/apache/Dockerfile index 68b422c20d..843aad55a4 100644 --- a/8.4/bookworm/apache/Dockerfile +++ b/8.4/bookworm/apache/Dockerfile @@ -120,9 +120,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -188,8 +188,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.4/bookworm/cli/Dockerfile b/8.4/bookworm/cli/Dockerfile index e129149317..cc27688a4d 100644 --- a/8.4/bookworm/cli/Dockerfile +++ b/8.4/bookworm/cli/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.4/bookworm/fpm/Dockerfile b/8.4/bookworm/fpm/Dockerfile index 44f4efd469..6db6beef85 100644 --- a/8.4/bookworm/fpm/Dockerfile +++ b/8.4/bookworm/fpm/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -226,20 +239,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -255,13 +264,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.4/bookworm/zts/Dockerfile b/8.4/bookworm/zts/Dockerfile index ca6b90535d..129ee8a674 100644 --- a/8.4/bookworm/zts/Dockerfile +++ b/8.4/bookworm/zts/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.4/trixie/apache/Dockerfile b/8.4/trixie/apache/Dockerfile index d5d83a2161..afb3d43102 100644 --- a/8.4/trixie/apache/Dockerfile +++ b/8.4/trixie/apache/Dockerfile @@ -120,9 +120,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -188,8 +188,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.4/trixie/cli/Dockerfile b/8.4/trixie/cli/Dockerfile index a3952872bd..a0c7ddd039 100644 --- a/8.4/trixie/cli/Dockerfile +++ b/8.4/trixie/cli/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.4/trixie/fpm/Dockerfile b/8.4/trixie/fpm/Dockerfile index d5d0fe8654..b754416d7c 100644 --- a/8.4/trixie/fpm/Dockerfile +++ b/8.4/trixie/fpm/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -226,20 +239,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -255,13 +264,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.4/trixie/zts/Dockerfile b/8.4/trixie/zts/Dockerfile index 33417fac1f..16751b35fe 100644 --- a/8.4/trixie/zts/Dockerfile +++ b/8.4/trixie/zts/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS AFD8691FDAEDF03BDF6E460563F15A9B715376CA 9D7F99A0CB8F05C8A6958D6256A97AF7600A39A6 0616E93D95AF471243E26761770426E17EBBB3DD -ENV PHP_VERSION 8.4.11 -ENV PHP_URL="https://www.php.net/distributions/php-8.4.11.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.11.tar.xz.asc" -ENV PHP_SHA256="04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00" +ENV PHP_VERSION 8.4.28 +ENV PHP_URL="https://www.php.net/distributions/php-8.4.28.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.4.28.tar.xz.asc" +ENV PHP_SHA256="0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.5-rc/alpine3.21/cli/Dockerfile b/8.5/alpine3.23/cli/Dockerfile similarity index 88% rename from 8.5-rc/alpine3.21/cli/Dockerfile rename to 8.5/alpine3.23/cli/Dockerfile index 180e5c4d47..3d43264f63 100644 --- a/8.5-rc/alpine3.21/cli/Dockerfile +++ b/8.5/alpine3.23/cli/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.23 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.3/alpine3.21/cli/docker-php-entrypoint b/8.5/alpine3.23/cli/docker-php-entrypoint similarity index 100% rename from 8.3/alpine3.21/cli/docker-php-entrypoint rename to 8.5/alpine3.23/cli/docker-php-entrypoint diff --git a/8.2/alpine3.22/fpm/docker-php-ext-configure b/8.5/alpine3.23/cli/docker-php-ext-configure similarity index 100% rename from 8.2/alpine3.22/fpm/docker-php-ext-configure rename to 8.5/alpine3.23/cli/docker-php-ext-configure diff --git a/8.2/alpine3.22/fpm/docker-php-ext-enable b/8.5/alpine3.23/cli/docker-php-ext-enable similarity index 100% rename from 8.2/alpine3.22/fpm/docker-php-ext-enable rename to 8.5/alpine3.23/cli/docker-php-ext-enable diff --git a/8.2/alpine3.22/fpm/docker-php-ext-install b/8.5/alpine3.23/cli/docker-php-ext-install similarity index 100% rename from 8.2/alpine3.22/fpm/docker-php-ext-install rename to 8.5/alpine3.23/cli/docker-php-ext-install diff --git a/8.2/alpine3.22/fpm/docker-php-source b/8.5/alpine3.23/cli/docker-php-source similarity index 100% rename from 8.2/alpine3.22/fpm/docker-php-source rename to 8.5/alpine3.23/cli/docker-php-source diff --git a/8.5-rc/alpine3.21/fpm/Dockerfile b/8.5/alpine3.23/fpm/Dockerfile similarity index 84% rename from 8.5-rc/alpine3.21/fpm/Dockerfile rename to 8.5/alpine3.23/fpm/Dockerfile index 57b213b9d0..9d2f175a62 100644 --- a/8.5-rc/alpine3.21/fpm/Dockerfile +++ b/8.5/alpine3.23/fpm/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.23 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -206,20 +219,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -235,13 +244,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.3/alpine3.21/fpm/docker-php-entrypoint b/8.5/alpine3.23/fpm/docker-php-entrypoint similarity index 100% rename from 8.3/alpine3.21/fpm/docker-php-entrypoint rename to 8.5/alpine3.23/fpm/docker-php-entrypoint diff --git a/8.2/alpine3.22/zts/docker-php-ext-configure b/8.5/alpine3.23/fpm/docker-php-ext-configure similarity index 100% rename from 8.2/alpine3.22/zts/docker-php-ext-configure rename to 8.5/alpine3.23/fpm/docker-php-ext-configure diff --git a/8.2/alpine3.22/zts/docker-php-ext-enable b/8.5/alpine3.23/fpm/docker-php-ext-enable similarity index 100% rename from 8.2/alpine3.22/zts/docker-php-ext-enable rename to 8.5/alpine3.23/fpm/docker-php-ext-enable diff --git a/8.2/alpine3.22/zts/docker-php-ext-install b/8.5/alpine3.23/fpm/docker-php-ext-install similarity index 100% rename from 8.2/alpine3.22/zts/docker-php-ext-install rename to 8.5/alpine3.23/fpm/docker-php-ext-install diff --git a/8.2/alpine3.22/zts/docker-php-source b/8.5/alpine3.23/fpm/docker-php-source similarity index 100% rename from 8.2/alpine3.22/zts/docker-php-source rename to 8.5/alpine3.23/fpm/docker-php-source diff --git a/8.5-rc/alpine3.21/zts/Dockerfile b/8.5/alpine3.23/zts/Dockerfile similarity index 89% rename from 8.5-rc/alpine3.21/zts/Dockerfile rename to 8.5/alpine3.23/zts/Dockerfile index 6c949b1f89..250ee35e64 100644 --- a/8.5-rc/alpine3.21/zts/Dockerfile +++ b/8.5/alpine3.23/zts/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.21 +FROM alpine:3.23 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.3/alpine3.21/zts/docker-php-entrypoint b/8.5/alpine3.23/zts/docker-php-entrypoint similarity index 100% rename from 8.3/alpine3.21/zts/docker-php-entrypoint rename to 8.5/alpine3.23/zts/docker-php-entrypoint diff --git a/8.3/alpine3.21/cli/docker-php-ext-configure b/8.5/alpine3.23/zts/docker-php-ext-configure similarity index 100% rename from 8.3/alpine3.21/cli/docker-php-ext-configure rename to 8.5/alpine3.23/zts/docker-php-ext-configure diff --git a/8.3/alpine3.21/cli/docker-php-ext-enable b/8.5/alpine3.23/zts/docker-php-ext-enable similarity index 100% rename from 8.3/alpine3.21/cli/docker-php-ext-enable rename to 8.5/alpine3.23/zts/docker-php-ext-enable diff --git a/8.3/alpine3.21/cli/docker-php-ext-install b/8.5/alpine3.23/zts/docker-php-ext-install similarity index 100% rename from 8.3/alpine3.21/cli/docker-php-ext-install rename to 8.5/alpine3.23/zts/docker-php-ext-install diff --git a/8.3/alpine3.21/cli/docker-php-source b/8.5/alpine3.23/zts/docker-php-source similarity index 100% rename from 8.3/alpine3.21/cli/docker-php-source rename to 8.5/alpine3.23/zts/docker-php-source diff --git a/8.5-rc/alpine3.22/cli/Dockerfile b/8.5/alpine3.24/cli/Dockerfile similarity index 88% rename from 8.5-rc/alpine3.22/cli/Dockerfile rename to 8.5/alpine3.24/cli/Dockerfile index 8812bf652b..f38910132e 100644 --- a/8.5-rc/alpine3.22/cli/Dockerfile +++ b/8.5/alpine3.24/cli/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.24 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.3/alpine3.22/cli/docker-php-entrypoint b/8.5/alpine3.24/cli/docker-php-entrypoint similarity index 100% rename from 8.3/alpine3.22/cli/docker-php-entrypoint rename to 8.5/alpine3.24/cli/docker-php-entrypoint diff --git a/8.3/alpine3.21/fpm/docker-php-ext-configure b/8.5/alpine3.24/cli/docker-php-ext-configure similarity index 100% rename from 8.3/alpine3.21/fpm/docker-php-ext-configure rename to 8.5/alpine3.24/cli/docker-php-ext-configure diff --git a/8.3/alpine3.21/fpm/docker-php-ext-enable b/8.5/alpine3.24/cli/docker-php-ext-enable similarity index 100% rename from 8.3/alpine3.21/fpm/docker-php-ext-enable rename to 8.5/alpine3.24/cli/docker-php-ext-enable diff --git a/8.3/alpine3.21/fpm/docker-php-ext-install b/8.5/alpine3.24/cli/docker-php-ext-install similarity index 100% rename from 8.3/alpine3.21/fpm/docker-php-ext-install rename to 8.5/alpine3.24/cli/docker-php-ext-install diff --git a/8.3/alpine3.21/fpm/docker-php-source b/8.5/alpine3.24/cli/docker-php-source similarity index 100% rename from 8.3/alpine3.21/fpm/docker-php-source rename to 8.5/alpine3.24/cli/docker-php-source diff --git a/8.5-rc/alpine3.22/fpm/Dockerfile b/8.5/alpine3.24/fpm/Dockerfile similarity index 84% rename from 8.5-rc/alpine3.22/fpm/Dockerfile rename to 8.5/alpine3.24/fpm/Dockerfile index 659da184cd..6ac58954e1 100644 --- a/8.5-rc/alpine3.22/fpm/Dockerfile +++ b/8.5/alpine3.24/fpm/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.24 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -206,20 +219,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -235,13 +244,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.3/alpine3.22/fpm/docker-php-entrypoint b/8.5/alpine3.24/fpm/docker-php-entrypoint similarity index 100% rename from 8.3/alpine3.22/fpm/docker-php-entrypoint rename to 8.5/alpine3.24/fpm/docker-php-entrypoint diff --git a/8.3/alpine3.21/zts/docker-php-ext-configure b/8.5/alpine3.24/fpm/docker-php-ext-configure similarity index 100% rename from 8.3/alpine3.21/zts/docker-php-ext-configure rename to 8.5/alpine3.24/fpm/docker-php-ext-configure diff --git a/8.3/alpine3.21/zts/docker-php-ext-enable b/8.5/alpine3.24/fpm/docker-php-ext-enable similarity index 100% rename from 8.3/alpine3.21/zts/docker-php-ext-enable rename to 8.5/alpine3.24/fpm/docker-php-ext-enable diff --git a/8.3/alpine3.21/zts/docker-php-ext-install b/8.5/alpine3.24/fpm/docker-php-ext-install similarity index 100% rename from 8.3/alpine3.21/zts/docker-php-ext-install rename to 8.5/alpine3.24/fpm/docker-php-ext-install diff --git a/8.3/alpine3.21/zts/docker-php-source b/8.5/alpine3.24/fpm/docker-php-source similarity index 100% rename from 8.3/alpine3.21/zts/docker-php-source rename to 8.5/alpine3.24/fpm/docker-php-source diff --git a/8.5-rc/alpine3.22/zts/Dockerfile b/8.5/alpine3.24/zts/Dockerfile similarity index 89% rename from 8.5-rc/alpine3.22/zts/Dockerfile rename to 8.5/alpine3.24/zts/Dockerfile index 24314ea7ba..cc0905e438 100644 --- a/8.5-rc/alpine3.22/zts/Dockerfile +++ b/8.5/alpine3.24/zts/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM alpine:3.22 +FROM alpine:3.24 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) @@ -56,9 +56,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -116,8 +116,21 @@ RUN set -eux; \ docker-php-source extract; \ cd /usr/src/php; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.3/alpine3.22/zts/docker-php-entrypoint b/8.5/alpine3.24/zts/docker-php-entrypoint similarity index 100% rename from 8.3/alpine3.22/zts/docker-php-entrypoint rename to 8.5/alpine3.24/zts/docker-php-entrypoint diff --git a/8.3/alpine3.22/cli/docker-php-ext-configure b/8.5/alpine3.24/zts/docker-php-ext-configure similarity index 100% rename from 8.3/alpine3.22/cli/docker-php-ext-configure rename to 8.5/alpine3.24/zts/docker-php-ext-configure diff --git a/8.3/alpine3.22/cli/docker-php-ext-enable b/8.5/alpine3.24/zts/docker-php-ext-enable similarity index 100% rename from 8.3/alpine3.22/cli/docker-php-ext-enable rename to 8.5/alpine3.24/zts/docker-php-ext-enable diff --git a/8.3/alpine3.22/cli/docker-php-ext-install b/8.5/alpine3.24/zts/docker-php-ext-install similarity index 100% rename from 8.3/alpine3.22/cli/docker-php-ext-install rename to 8.5/alpine3.24/zts/docker-php-ext-install diff --git a/8.3/alpine3.22/cli/docker-php-source b/8.5/alpine3.24/zts/docker-php-source similarity index 100% rename from 8.3/alpine3.22/cli/docker-php-source rename to 8.5/alpine3.24/zts/docker-php-source diff --git a/8.5-rc/bookworm/apache/Dockerfile b/8.5/bookworm/apache/Dockerfile similarity index 92% rename from 8.5-rc/bookworm/apache/Dockerfile rename to 8.5/bookworm/apache/Dockerfile index 88bc129927..1774a502b4 100644 --- a/8.5-rc/bookworm/apache/Dockerfile +++ b/8.5/bookworm/apache/Dockerfile @@ -120,9 +120,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -188,8 +188,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.1/bookworm/apache/apache2-foreground b/8.5/bookworm/apache/apache2-foreground similarity index 100% rename from 8.1/bookworm/apache/apache2-foreground rename to 8.5/bookworm/apache/apache2-foreground diff --git a/8.1/bookworm/apache/docker-php-entrypoint b/8.5/bookworm/apache/docker-php-entrypoint similarity index 100% rename from 8.1/bookworm/apache/docker-php-entrypoint rename to 8.5/bookworm/apache/docker-php-entrypoint diff --git a/8.3/alpine3.22/fpm/docker-php-ext-configure b/8.5/bookworm/apache/docker-php-ext-configure similarity index 100% rename from 8.3/alpine3.22/fpm/docker-php-ext-configure rename to 8.5/bookworm/apache/docker-php-ext-configure diff --git a/8.3/alpine3.22/fpm/docker-php-ext-enable b/8.5/bookworm/apache/docker-php-ext-enable similarity index 100% rename from 8.3/alpine3.22/fpm/docker-php-ext-enable rename to 8.5/bookworm/apache/docker-php-ext-enable diff --git a/8.3/alpine3.22/fpm/docker-php-ext-install b/8.5/bookworm/apache/docker-php-ext-install similarity index 100% rename from 8.3/alpine3.22/fpm/docker-php-ext-install rename to 8.5/bookworm/apache/docker-php-ext-install diff --git a/8.3/alpine3.22/fpm/docker-php-source b/8.5/bookworm/apache/docker-php-source similarity index 100% rename from 8.3/alpine3.22/fpm/docker-php-source rename to 8.5/bookworm/apache/docker-php-source diff --git a/8.5-rc/bookworm/cli/Dockerfile b/8.5/bookworm/cli/Dockerfile similarity index 90% rename from 8.5-rc/bookworm/cli/Dockerfile rename to 8.5/bookworm/cli/Dockerfile index a5bb3d7093..a9561ad99e 100644 --- a/8.5-rc/bookworm/cli/Dockerfile +++ b/8.5/bookworm/cli/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.4/alpine3.21/cli/docker-php-entrypoint b/8.5/bookworm/cli/docker-php-entrypoint similarity index 100% rename from 8.4/alpine3.21/cli/docker-php-entrypoint rename to 8.5/bookworm/cli/docker-php-entrypoint diff --git a/8.3/alpine3.22/zts/docker-php-ext-configure b/8.5/bookworm/cli/docker-php-ext-configure similarity index 100% rename from 8.3/alpine3.22/zts/docker-php-ext-configure rename to 8.5/bookworm/cli/docker-php-ext-configure diff --git a/8.3/alpine3.22/zts/docker-php-ext-enable b/8.5/bookworm/cli/docker-php-ext-enable similarity index 100% rename from 8.3/alpine3.22/zts/docker-php-ext-enable rename to 8.5/bookworm/cli/docker-php-ext-enable diff --git a/8.3/alpine3.22/zts/docker-php-ext-install b/8.5/bookworm/cli/docker-php-ext-install similarity index 100% rename from 8.3/alpine3.22/zts/docker-php-ext-install rename to 8.5/bookworm/cli/docker-php-ext-install diff --git a/8.3/alpine3.22/zts/docker-php-source b/8.5/bookworm/cli/docker-php-source similarity index 100% rename from 8.3/alpine3.22/zts/docker-php-source rename to 8.5/bookworm/cli/docker-php-source diff --git a/8.5-rc/bookworm/fpm/Dockerfile b/8.5/bookworm/fpm/Dockerfile similarity index 86% rename from 8.5-rc/bookworm/fpm/Dockerfile rename to 8.5/bookworm/fpm/Dockerfile index f396894e85..006a75f515 100644 --- a/8.5-rc/bookworm/fpm/Dockerfile +++ b/8.5/bookworm/fpm/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -223,20 +236,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -252,13 +261,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.4/alpine3.21/fpm/docker-php-entrypoint b/8.5/bookworm/fpm/docker-php-entrypoint similarity index 100% rename from 8.4/alpine3.21/fpm/docker-php-entrypoint rename to 8.5/bookworm/fpm/docker-php-entrypoint diff --git a/8.4/alpine3.21/cli/docker-php-ext-configure b/8.5/bookworm/fpm/docker-php-ext-configure similarity index 100% rename from 8.4/alpine3.21/cli/docker-php-ext-configure rename to 8.5/bookworm/fpm/docker-php-ext-configure diff --git a/8.4/alpine3.21/cli/docker-php-ext-enable b/8.5/bookworm/fpm/docker-php-ext-enable similarity index 100% rename from 8.4/alpine3.21/cli/docker-php-ext-enable rename to 8.5/bookworm/fpm/docker-php-ext-enable diff --git a/8.4/alpine3.21/cli/docker-php-ext-install b/8.5/bookworm/fpm/docker-php-ext-install similarity index 100% rename from 8.4/alpine3.21/cli/docker-php-ext-install rename to 8.5/bookworm/fpm/docker-php-ext-install diff --git a/8.4/alpine3.21/cli/docker-php-source b/8.5/bookworm/fpm/docker-php-source similarity index 100% rename from 8.4/alpine3.21/cli/docker-php-source rename to 8.5/bookworm/fpm/docker-php-source diff --git a/8.5-rc/bookworm/zts/Dockerfile b/8.5/bookworm/zts/Dockerfile similarity index 90% rename from 8.5-rc/bookworm/zts/Dockerfile rename to 8.5/bookworm/zts/Dockerfile index 3f33b979e4..b50d60333b 100644 --- a/8.5-rc/bookworm/zts/Dockerfile +++ b/8.5/bookworm/zts/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.4/alpine3.21/zts/docker-php-entrypoint b/8.5/bookworm/zts/docker-php-entrypoint similarity index 100% rename from 8.4/alpine3.21/zts/docker-php-entrypoint rename to 8.5/bookworm/zts/docker-php-entrypoint diff --git a/8.4/alpine3.21/fpm/docker-php-ext-configure b/8.5/bookworm/zts/docker-php-ext-configure similarity index 100% rename from 8.4/alpine3.21/fpm/docker-php-ext-configure rename to 8.5/bookworm/zts/docker-php-ext-configure diff --git a/8.4/alpine3.21/fpm/docker-php-ext-enable b/8.5/bookworm/zts/docker-php-ext-enable similarity index 100% rename from 8.4/alpine3.21/fpm/docker-php-ext-enable rename to 8.5/bookworm/zts/docker-php-ext-enable diff --git a/8.4/alpine3.21/fpm/docker-php-ext-install b/8.5/bookworm/zts/docker-php-ext-install similarity index 100% rename from 8.4/alpine3.21/fpm/docker-php-ext-install rename to 8.5/bookworm/zts/docker-php-ext-install diff --git a/8.4/alpine3.21/fpm/docker-php-source b/8.5/bookworm/zts/docker-php-source similarity index 100% rename from 8.4/alpine3.21/fpm/docker-php-source rename to 8.5/bookworm/zts/docker-php-source diff --git a/8.5-rc/trixie/apache/Dockerfile b/8.5/trixie/apache/Dockerfile similarity index 92% rename from 8.5-rc/trixie/apache/Dockerfile rename to 8.5/trixie/apache/Dockerfile index a208f9dfee..ffc00750ef 100644 --- a/8.5-rc/trixie/apache/Dockerfile +++ b/8.5/trixie/apache/Dockerfile @@ -120,9 +120,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -188,8 +188,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.1/trixie/apache/apache2-foreground b/8.5/trixie/apache/apache2-foreground similarity index 100% rename from 8.1/trixie/apache/apache2-foreground rename to 8.5/trixie/apache/apache2-foreground diff --git a/8.1/trixie/apache/docker-php-entrypoint b/8.5/trixie/apache/docker-php-entrypoint similarity index 100% rename from 8.1/trixie/apache/docker-php-entrypoint rename to 8.5/trixie/apache/docker-php-entrypoint diff --git a/8.4/alpine3.21/zts/docker-php-ext-configure b/8.5/trixie/apache/docker-php-ext-configure similarity index 100% rename from 8.4/alpine3.21/zts/docker-php-ext-configure rename to 8.5/trixie/apache/docker-php-ext-configure diff --git a/8.4/alpine3.21/zts/docker-php-ext-enable b/8.5/trixie/apache/docker-php-ext-enable similarity index 100% rename from 8.4/alpine3.21/zts/docker-php-ext-enable rename to 8.5/trixie/apache/docker-php-ext-enable diff --git a/8.4/alpine3.21/zts/docker-php-ext-install b/8.5/trixie/apache/docker-php-ext-install similarity index 100% rename from 8.4/alpine3.21/zts/docker-php-ext-install rename to 8.5/trixie/apache/docker-php-ext-install diff --git a/8.4/alpine3.21/zts/docker-php-source b/8.5/trixie/apache/docker-php-source similarity index 100% rename from 8.4/alpine3.21/zts/docker-php-source rename to 8.5/trixie/apache/docker-php-source diff --git a/8.5-rc/trixie/cli/Dockerfile b/8.5/trixie/cli/Dockerfile similarity index 90% rename from 8.5-rc/trixie/cli/Dockerfile rename to 8.5/trixie/cli/Dockerfile index 8e6187fcb1..eeeb8f5dcd 100644 --- a/8.5-rc/trixie/cli/Dockerfile +++ b/8.5/trixie/cli/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.4/alpine3.22/cli/docker-php-entrypoint b/8.5/trixie/cli/docker-php-entrypoint similarity index 100% rename from 8.4/alpine3.22/cli/docker-php-entrypoint rename to 8.5/trixie/cli/docker-php-entrypoint diff --git a/8.4/alpine3.22/cli/docker-php-ext-configure b/8.5/trixie/cli/docker-php-ext-configure similarity index 100% rename from 8.4/alpine3.22/cli/docker-php-ext-configure rename to 8.5/trixie/cli/docker-php-ext-configure diff --git a/8.4/alpine3.22/cli/docker-php-ext-enable b/8.5/trixie/cli/docker-php-ext-enable similarity index 100% rename from 8.4/alpine3.22/cli/docker-php-ext-enable rename to 8.5/trixie/cli/docker-php-ext-enable diff --git a/8.4/alpine3.22/cli/docker-php-ext-install b/8.5/trixie/cli/docker-php-ext-install similarity index 100% rename from 8.4/alpine3.22/cli/docker-php-ext-install rename to 8.5/trixie/cli/docker-php-ext-install diff --git a/8.4/alpine3.22/cli/docker-php-source b/8.5/trixie/cli/docker-php-source similarity index 100% rename from 8.4/alpine3.22/cli/docker-php-source rename to 8.5/trixie/cli/docker-php-source diff --git a/8.5-rc/trixie/fpm/Dockerfile b/8.5/trixie/fpm/Dockerfile similarity index 86% rename from 8.5-rc/trixie/fpm/Dockerfile rename to 8.5/trixie/fpm/Dockerfile index aac127af15..1215d9321b 100644 --- a/8.5-rc/trixie/fpm/Dockerfile +++ b/8.5/trixie/fpm/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -223,20 +236,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -252,13 +261,16 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.4/alpine3.22/fpm/docker-php-entrypoint b/8.5/trixie/fpm/docker-php-entrypoint similarity index 100% rename from 8.4/alpine3.22/fpm/docker-php-entrypoint rename to 8.5/trixie/fpm/docker-php-entrypoint diff --git a/8.4/alpine3.22/fpm/docker-php-ext-configure b/8.5/trixie/fpm/docker-php-ext-configure similarity index 100% rename from 8.4/alpine3.22/fpm/docker-php-ext-configure rename to 8.5/trixie/fpm/docker-php-ext-configure diff --git a/8.4/alpine3.22/fpm/docker-php-ext-enable b/8.5/trixie/fpm/docker-php-ext-enable similarity index 100% rename from 8.4/alpine3.22/fpm/docker-php-ext-enable rename to 8.5/trixie/fpm/docker-php-ext-enable diff --git a/8.4/alpine3.22/fpm/docker-php-ext-install b/8.5/trixie/fpm/docker-php-ext-install similarity index 100% rename from 8.4/alpine3.22/fpm/docker-php-ext-install rename to 8.5/trixie/fpm/docker-php-ext-install diff --git a/8.4/alpine3.22/fpm/docker-php-source b/8.5/trixie/fpm/docker-php-source similarity index 100% rename from 8.4/alpine3.22/fpm/docker-php-source rename to 8.5/trixie/fpm/docker-php-source diff --git a/8.5-rc/trixie/zts/Dockerfile b/8.5/trixie/zts/Dockerfile similarity index 90% rename from 8.5-rc/trixie/zts/Dockerfile rename to 8.5/trixie/zts/Dockerfile index 95612c3d15..9ac74121f9 100644 --- a/8.5-rc/trixie/zts/Dockerfile +++ b/8.5/trixie/zts/Dockerfile @@ -60,9 +60,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5 -ENV PHP_VERSION 8.5.0alpha4 -ENV PHP_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz" PHP_ASC_URL="https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc" -ENV PHP_SHA256="5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db" +ENV PHP_VERSION 8.5.13 +ENV PHP_URL="https://www.php.net/distributions/php-8.5.13.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.5.13.tar.xz.asc" +ENV PHP_SHA256="607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f" RUN set -eux; \ \ @@ -127,8 +127,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ diff --git a/8.4/alpine3.22/zts/docker-php-entrypoint b/8.5/trixie/zts/docker-php-entrypoint similarity index 100% rename from 8.4/alpine3.22/zts/docker-php-entrypoint rename to 8.5/trixie/zts/docker-php-entrypoint diff --git a/8.4/alpine3.22/zts/docker-php-ext-configure b/8.5/trixie/zts/docker-php-ext-configure similarity index 100% rename from 8.4/alpine3.22/zts/docker-php-ext-configure rename to 8.5/trixie/zts/docker-php-ext-configure diff --git a/8.4/alpine3.22/zts/docker-php-ext-enable b/8.5/trixie/zts/docker-php-ext-enable similarity index 100% rename from 8.4/alpine3.22/zts/docker-php-ext-enable rename to 8.5/trixie/zts/docker-php-ext-enable diff --git a/8.4/alpine3.22/zts/docker-php-ext-install b/8.5/trixie/zts/docker-php-ext-install similarity index 100% rename from 8.4/alpine3.22/zts/docker-php-ext-install rename to 8.5/trixie/zts/docker-php-ext-install diff --git a/8.4/alpine3.22/zts/docker-php-source b/8.5/trixie/zts/docker-php-source similarity index 100% rename from 8.4/alpine3.22/zts/docker-php-source rename to 8.5/trixie/zts/docker-php-source diff --git a/8.6/alpine3.23/cli/Dockerfile b/8.6/alpine3.23/cli/Dockerfile new file mode 100644 index 0000000000..e3d48c837c --- /dev/null +++ b/8.6/alpine3.23/cli/Dockerfile @@ -0,0 +1,209 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.23 + +# dependencies required for running "phpize" +# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev dpkg \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkgconf \ + re2c + +# persistent / runtime deps +RUN apk add --no-cache \ + ca-certificates \ + curl \ + openssl \ + tar \ + xz + +# ensure www-data user exists +RUN set -eux; \ + adduser -u 82 -D -S -G www-data www-data +# 82 is the standard uid/gid for "www-data" in Alpine +# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.14-stable +# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable +# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable + +ENV PHP_INI_DIR /usr/local/etc/php +RUN set -eux; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ +# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) + [ ! -d /var/www/html ]; \ + mkdir -p /var/www/html; \ + chown www-data:www-data /var/www/html; \ + chmod 1777 /var/www/html + +# Apply stack smash protection to functions using local buffers and alloca() +# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) +# Enable optimization (-O2) +# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) +# https://github.com/docker-library/php/issues/272 +# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) +ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +ENV PHP_CPPFLAGS="$PHP_CFLAGS" +ENV PHP_LDFLAGS="-Wl,-O1 -pie" + +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E + +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" + +RUN set -eux; \ + \ + apk add --no-cache --virtual .fetch-deps gnupg; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME"; \ + \ + apk del --no-network .fetch-deps + +COPY docker-php-source /usr/local/bin/ + +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + argon2-dev \ + coreutils \ + curl-dev \ + gnu-libiconv-dev \ + libsodium-dev \ + libxml2-dev \ + linux-headers \ + openssl-dev \ + readline-dev \ + sqlite-dev \ + ; \ + \ +# make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) + rm -vf /usr/include/iconv.h; \ + \ + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ +# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 + PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ + PHP_UNAME='Linux - Docker' \ + ; \ + docker-php-source extract; \ + cd /usr/src/php; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ + ./configure \ + --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + \ +# make sure invalid --configure-flags are fatal errors instead of just warnings + --enable-option-checking=fatal \ + \ +# https://github.com/docker-library/php/issues/439 + --with-mhash \ + \ +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 +# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ +# https://wiki.php.net/rfc/argon2_password_hash + --with-password-argon2 \ +# https://wiki.php.net/rfc/libsodium + --with-sodium=shared \ +# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) + --with-pdo-sqlite=/usr \ + --with-sqlite3=/usr \ + \ + --with-curl \ + --with-iconv=/usr \ + --with-openssl \ + --with-readline \ + --with-zlib \ + \ +# https://github.com/docker-library/php/pull/1259 + --enable-phpdbg \ + --enable-phpdbg-readline \ + \ + \ +# https://github.com/docker-library/php/pull/939#issuecomment-730501748 + --enable-embed \ + \ + --enable-zts \ +# https://externals.io/message/118859 + --disable-zend-signals \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' + \ + ; \ + make clean; \ + \ +# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) + cp -v php.ini-* "$PHP_INI_DIR/"; \ + \ + cd /; \ + docker-php-source delete; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-cache $runDeps; \ + \ + apk del --no-network .build-deps; \ + \ +# smoke test + php --version + +COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ + +# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) +RUN docker-php-ext-enable sodium + +ENTRYPOINT ["docker-php-entrypoint"] +CMD ["php", "-a"] diff --git a/8.5-rc/alpine3.21/cli/docker-php-entrypoint b/8.6/alpine3.23/cli/docker-php-entrypoint similarity index 100% rename from 8.5-rc/alpine3.21/cli/docker-php-entrypoint rename to 8.6/alpine3.23/cli/docker-php-entrypoint diff --git a/8.5-rc/alpine3.21/cli/docker-php-ext-configure b/8.6/alpine3.23/cli/docker-php-ext-configure similarity index 100% rename from 8.5-rc/alpine3.21/cli/docker-php-ext-configure rename to 8.6/alpine3.23/cli/docker-php-ext-configure diff --git a/8.5-rc/alpine3.21/cli/docker-php-ext-enable b/8.6/alpine3.23/cli/docker-php-ext-enable similarity index 100% rename from 8.5-rc/alpine3.21/cli/docker-php-ext-enable rename to 8.6/alpine3.23/cli/docker-php-ext-enable diff --git a/8.5-rc/alpine3.21/cli/docker-php-ext-install b/8.6/alpine3.23/cli/docker-php-ext-install similarity index 100% rename from 8.5-rc/alpine3.21/cli/docker-php-ext-install rename to 8.6/alpine3.23/cli/docker-php-ext-install diff --git a/8.5-rc/alpine3.21/cli/docker-php-source b/8.6/alpine3.23/cli/docker-php-source similarity index 100% rename from 8.5-rc/alpine3.21/cli/docker-php-source rename to 8.6/alpine3.23/cli/docker-php-source diff --git a/8.6/alpine3.23/fpm/Dockerfile b/8.6/alpine3.23/fpm/Dockerfile new file mode 100644 index 0000000000..eb0c829e09 --- /dev/null +++ b/8.6/alpine3.23/fpm/Dockerfile @@ -0,0 +1,258 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.23 + +# dependencies required for running "phpize" +# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev dpkg \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkgconf \ + re2c + +# persistent / runtime deps +RUN apk add --no-cache \ + ca-certificates \ + curl \ + openssl \ + tar \ + xz + +# ensure www-data user exists +RUN set -eux; \ + adduser -u 82 -D -S -G www-data www-data +# 82 is the standard uid/gid for "www-data" in Alpine +# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.14-stable +# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable +# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable + +ENV PHP_INI_DIR /usr/local/etc/php +RUN set -eux; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ +# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) + [ ! -d /var/www/html ]; \ + mkdir -p /var/www/html; \ + chown www-data:www-data /var/www/html; \ + chmod 1777 /var/www/html + +# Apply stack smash protection to functions using local buffers and alloca() +# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) +# Enable optimization (-O2) +# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) +# https://github.com/docker-library/php/issues/272 +# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) +ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +ENV PHP_CPPFLAGS="$PHP_CFLAGS" +ENV PHP_LDFLAGS="-Wl,-O1 -pie" + +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E + +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" + +RUN set -eux; \ + \ + apk add --no-cache --virtual .fetch-deps gnupg; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME"; \ + \ + apk del --no-network .fetch-deps + +COPY docker-php-source /usr/local/bin/ + +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + argon2-dev \ + coreutils \ + curl-dev \ + gnu-libiconv-dev \ + libsodium-dev \ + libxml2-dev \ + linux-headers \ + openssl-dev \ + readline-dev \ + sqlite-dev \ + ; \ + \ +# make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) + rm -vf /usr/include/iconv.h; \ + \ + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ +# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 + PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ + PHP_UNAME='Linux - Docker' \ + ; \ + docker-php-source extract; \ + cd /usr/src/php; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ + ./configure \ + --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + \ +# make sure invalid --configure-flags are fatal errors instead of just warnings + --enable-option-checking=fatal \ + \ +# https://github.com/docker-library/php/issues/439 + --with-mhash \ + \ +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 +# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ +# https://wiki.php.net/rfc/argon2_password_hash + --with-password-argon2 \ +# https://wiki.php.net/rfc/libsodium + --with-sodium=shared \ +# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) + --with-pdo-sqlite=/usr \ + --with-sqlite3=/usr \ + \ + --with-curl \ + --with-iconv=/usr \ + --with-openssl \ + --with-readline \ + --with-zlib \ + \ +# https://github.com/bwoebi/phpdbg-docs/issues/1#issuecomment-163872806 ("phpdbg is primarily a CLI debugger, and is not suitable for debugging an fpm stack.") + --disable-phpdbg \ + \ + \ + --disable-cgi \ + \ + --enable-fpm \ + --with-fpm-user=www-data \ + --with-fpm-group=www-data \ + \ + --enable-zts \ +# https://externals.io/message/118859 + --disable-zend-signals \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' + \ + ; \ + make clean; \ + \ +# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) + cp -v php.ini-* "$PHP_INI_DIR/"; \ + \ + cd /; \ + docker-php-source delete; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-cache $runDeps; \ + \ + apk del --no-network .build-deps; \ + \ +# smoke test + php --version + +COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ + +# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) +RUN docker-php-ext-enable sodium + +ENTRYPOINT ["docker-php-entrypoint"] +WORKDIR /var/www/html + +RUN set -eux; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ + { \ + echo '[global]'; \ + echo 'error_log = /proc/self/fd/2'; \ + echo; echo '; https://github.com/docker-library/php/pull/725#issuecomment-443540114'; echo 'log_limit = 8192'; \ + echo; \ + echo '[www]'; \ + echo '; php-fpm closes STDOUT on startup, so sending logs to /proc/self/fd/1 does not work.'; \ + echo '; https://bugs.php.net/bug.php?id=73886'; \ + echo 'access.log = /proc/self/fd/2'; \ + echo; \ + echo 'clear_env = no'; \ + echo; \ + echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ + echo 'catch_workers_output = yes'; \ + echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ + } | tee php-fpm.d/docker.conf; \ + { \ + echo '[global]'; \ + echo 'daemonize = no'; \ + } | tee php-fpm.d/zz-docker.conf; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ + { \ + echo '; https://github.com/docker-library/php/issues/878#issuecomment-938595965'; \ + echo 'fastcgi.logging = Off'; \ + } > "$PHP_INI_DIR/conf.d/docker-fpm.ini" + +# Override stop signal to stop process gracefully +# https://github.com/php/php-src/blob/17baa87faddc2550def3ae7314236826bc1b1398/sapi/fpm/php-fpm.8.in#L163 +STOPSIGNAL SIGQUIT + +EXPOSE 9000 +CMD ["php-fpm"] diff --git a/8.5-rc/alpine3.21/fpm/docker-php-entrypoint b/8.6/alpine3.23/fpm/docker-php-entrypoint similarity index 100% rename from 8.5-rc/alpine3.21/fpm/docker-php-entrypoint rename to 8.6/alpine3.23/fpm/docker-php-entrypoint diff --git a/8.5-rc/alpine3.21/fpm/docker-php-ext-configure b/8.6/alpine3.23/fpm/docker-php-ext-configure similarity index 100% rename from 8.5-rc/alpine3.21/fpm/docker-php-ext-configure rename to 8.6/alpine3.23/fpm/docker-php-ext-configure diff --git a/8.5-rc/alpine3.21/fpm/docker-php-ext-enable b/8.6/alpine3.23/fpm/docker-php-ext-enable similarity index 100% rename from 8.5-rc/alpine3.21/fpm/docker-php-ext-enable rename to 8.6/alpine3.23/fpm/docker-php-ext-enable diff --git a/8.5-rc/alpine3.21/fpm/docker-php-ext-install b/8.6/alpine3.23/fpm/docker-php-ext-install similarity index 100% rename from 8.5-rc/alpine3.21/fpm/docker-php-ext-install rename to 8.6/alpine3.23/fpm/docker-php-ext-install diff --git a/8.5-rc/alpine3.21/fpm/docker-php-source b/8.6/alpine3.23/fpm/docker-php-source similarity index 100% rename from 8.5-rc/alpine3.21/fpm/docker-php-source rename to 8.6/alpine3.23/fpm/docker-php-source diff --git a/8.6/alpine3.23/nts/Dockerfile b/8.6/alpine3.23/nts/Dockerfile new file mode 100644 index 0000000000..08791b96c3 --- /dev/null +++ b/8.6/alpine3.23/nts/Dockerfile @@ -0,0 +1,202 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.23 + +# dependencies required for running "phpize" +# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev dpkg \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkgconf \ + re2c + +# persistent / runtime deps +RUN apk add --no-cache \ + ca-certificates \ + curl \ + openssl \ + tar \ + xz + +# ensure www-data user exists +RUN set -eux; \ + adduser -u 82 -D -S -G www-data www-data +# 82 is the standard uid/gid for "www-data" in Alpine +# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.14-stable +# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable +# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable + +ENV PHP_INI_DIR /usr/local/etc/php +RUN set -eux; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ +# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) + [ ! -d /var/www/html ]; \ + mkdir -p /var/www/html; \ + chown www-data:www-data /var/www/html; \ + chmod 1777 /var/www/html + +# Apply stack smash protection to functions using local buffers and alloca() +# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) +# Enable optimization (-O2) +# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) +# https://github.com/docker-library/php/issues/272 +# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) +ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +ENV PHP_CPPFLAGS="$PHP_CFLAGS" +ENV PHP_LDFLAGS="-Wl,-O1 -pie" + +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E + +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" + +RUN set -eux; \ + \ + apk add --no-cache --virtual .fetch-deps gnupg; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME"; \ + \ + apk del --no-network .fetch-deps + +COPY docker-php-source /usr/local/bin/ + +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + argon2-dev \ + coreutils \ + curl-dev \ + gnu-libiconv-dev \ + libsodium-dev \ + libxml2-dev \ + linux-headers \ + openssl-dev \ + readline-dev \ + sqlite-dev \ + ; \ + \ +# make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) + rm -vf /usr/include/iconv.h; \ + \ + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ +# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 + PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ + PHP_UNAME='Linux - Docker' \ + ; \ + docker-php-source extract; \ + cd /usr/src/php; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ + ./configure \ + --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + \ +# make sure invalid --configure-flags are fatal errors instead of just warnings + --enable-option-checking=fatal \ + \ +# https://github.com/docker-library/php/issues/439 + --with-mhash \ + \ +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 +# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ +# https://wiki.php.net/rfc/argon2_password_hash + --with-password-argon2 \ +# https://wiki.php.net/rfc/libsodium + --with-sodium=shared \ +# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) + --with-pdo-sqlite=/usr \ + --with-sqlite3=/usr \ + \ + --with-curl \ + --with-iconv=/usr \ + --with-openssl \ + --with-readline \ + --with-zlib \ + \ +# https://github.com/docker-library/php/pull/1259 + --enable-phpdbg \ + --enable-phpdbg-readline \ + \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' + \ + ; \ + make clean; \ + \ +# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) + cp -v php.ini-* "$PHP_INI_DIR/"; \ + \ + cd /; \ + docker-php-source delete; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-cache $runDeps; \ + \ + apk del --no-network .build-deps; \ + \ +# smoke test + php --version + +COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ + +# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) +RUN docker-php-ext-enable sodium + +ENTRYPOINT ["docker-php-entrypoint"] +CMD ["php", "-a"] diff --git a/8.5-rc/alpine3.21/zts/docker-php-entrypoint b/8.6/alpine3.23/nts/docker-php-entrypoint similarity index 100% rename from 8.5-rc/alpine3.21/zts/docker-php-entrypoint rename to 8.6/alpine3.23/nts/docker-php-entrypoint diff --git a/8.5-rc/alpine3.21/zts/docker-php-ext-configure b/8.6/alpine3.23/nts/docker-php-ext-configure similarity index 100% rename from 8.5-rc/alpine3.21/zts/docker-php-ext-configure rename to 8.6/alpine3.23/nts/docker-php-ext-configure diff --git a/8.5-rc/alpine3.21/zts/docker-php-ext-enable b/8.6/alpine3.23/nts/docker-php-ext-enable similarity index 100% rename from 8.5-rc/alpine3.21/zts/docker-php-ext-enable rename to 8.6/alpine3.23/nts/docker-php-ext-enable diff --git a/8.5-rc/alpine3.21/zts/docker-php-ext-install b/8.6/alpine3.23/nts/docker-php-ext-install similarity index 100% rename from 8.5-rc/alpine3.21/zts/docker-php-ext-install rename to 8.6/alpine3.23/nts/docker-php-ext-install diff --git a/8.5-rc/alpine3.21/zts/docker-php-source b/8.6/alpine3.23/nts/docker-php-source similarity index 100% rename from 8.5-rc/alpine3.21/zts/docker-php-source rename to 8.6/alpine3.23/nts/docker-php-source diff --git a/8.6/alpine3.24/cli/Dockerfile b/8.6/alpine3.24/cli/Dockerfile new file mode 100644 index 0000000000..db71ac3b4b --- /dev/null +++ b/8.6/alpine3.24/cli/Dockerfile @@ -0,0 +1,209 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.24 + +# dependencies required for running "phpize" +# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev dpkg \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkgconf \ + re2c + +# persistent / runtime deps +RUN apk add --no-cache \ + ca-certificates \ + curl \ + openssl \ + tar \ + xz + +# ensure www-data user exists +RUN set -eux; \ + adduser -u 82 -D -S -G www-data www-data +# 82 is the standard uid/gid for "www-data" in Alpine +# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.14-stable +# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable +# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable + +ENV PHP_INI_DIR /usr/local/etc/php +RUN set -eux; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ +# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) + [ ! -d /var/www/html ]; \ + mkdir -p /var/www/html; \ + chown www-data:www-data /var/www/html; \ + chmod 1777 /var/www/html + +# Apply stack smash protection to functions using local buffers and alloca() +# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) +# Enable optimization (-O2) +# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) +# https://github.com/docker-library/php/issues/272 +# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) +ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +ENV PHP_CPPFLAGS="$PHP_CFLAGS" +ENV PHP_LDFLAGS="-Wl,-O1 -pie" + +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E + +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" + +RUN set -eux; \ + \ + apk add --no-cache --virtual .fetch-deps gnupg; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME"; \ + \ + apk del --no-network .fetch-deps + +COPY docker-php-source /usr/local/bin/ + +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + argon2-dev \ + coreutils \ + curl-dev \ + gnu-libiconv-dev \ + libsodium-dev \ + libxml2-dev \ + linux-headers \ + openssl-dev \ + readline-dev \ + sqlite-dev \ + ; \ + \ +# make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) + rm -vf /usr/include/iconv.h; \ + \ + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ +# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 + PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ + PHP_UNAME='Linux - Docker' \ + ; \ + docker-php-source extract; \ + cd /usr/src/php; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ + ./configure \ + --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + \ +# make sure invalid --configure-flags are fatal errors instead of just warnings + --enable-option-checking=fatal \ + \ +# https://github.com/docker-library/php/issues/439 + --with-mhash \ + \ +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 +# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ +# https://wiki.php.net/rfc/argon2_password_hash + --with-password-argon2 \ +# https://wiki.php.net/rfc/libsodium + --with-sodium=shared \ +# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) + --with-pdo-sqlite=/usr \ + --with-sqlite3=/usr \ + \ + --with-curl \ + --with-iconv=/usr \ + --with-openssl \ + --with-readline \ + --with-zlib \ + \ +# https://github.com/docker-library/php/pull/1259 + --enable-phpdbg \ + --enable-phpdbg-readline \ + \ + \ +# https://github.com/docker-library/php/pull/939#issuecomment-730501748 + --enable-embed \ + \ + --enable-zts \ +# https://externals.io/message/118859 + --disable-zend-signals \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' + \ + ; \ + make clean; \ + \ +# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) + cp -v php.ini-* "$PHP_INI_DIR/"; \ + \ + cd /; \ + docker-php-source delete; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-cache $runDeps; \ + \ + apk del --no-network .build-deps; \ + \ +# smoke test + php --version + +COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ + +# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) +RUN docker-php-ext-enable sodium + +ENTRYPOINT ["docker-php-entrypoint"] +CMD ["php", "-a"] diff --git a/8.5-rc/alpine3.22/cli/docker-php-entrypoint b/8.6/alpine3.24/cli/docker-php-entrypoint similarity index 100% rename from 8.5-rc/alpine3.22/cli/docker-php-entrypoint rename to 8.6/alpine3.24/cli/docker-php-entrypoint diff --git a/8.5-rc/alpine3.22/cli/docker-php-ext-configure b/8.6/alpine3.24/cli/docker-php-ext-configure similarity index 100% rename from 8.5-rc/alpine3.22/cli/docker-php-ext-configure rename to 8.6/alpine3.24/cli/docker-php-ext-configure diff --git a/8.5-rc/alpine3.22/cli/docker-php-ext-enable b/8.6/alpine3.24/cli/docker-php-ext-enable similarity index 100% rename from 8.5-rc/alpine3.22/cli/docker-php-ext-enable rename to 8.6/alpine3.24/cli/docker-php-ext-enable diff --git a/8.5-rc/alpine3.22/cli/docker-php-ext-install b/8.6/alpine3.24/cli/docker-php-ext-install similarity index 100% rename from 8.5-rc/alpine3.22/cli/docker-php-ext-install rename to 8.6/alpine3.24/cli/docker-php-ext-install diff --git a/8.5-rc/alpine3.22/cli/docker-php-source b/8.6/alpine3.24/cli/docker-php-source similarity index 100% rename from 8.5-rc/alpine3.22/cli/docker-php-source rename to 8.6/alpine3.24/cli/docker-php-source diff --git a/8.6/alpine3.24/fpm/Dockerfile b/8.6/alpine3.24/fpm/Dockerfile new file mode 100644 index 0000000000..b9e5a7172d --- /dev/null +++ b/8.6/alpine3.24/fpm/Dockerfile @@ -0,0 +1,258 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.24 + +# dependencies required for running "phpize" +# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev dpkg \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkgconf \ + re2c + +# persistent / runtime deps +RUN apk add --no-cache \ + ca-certificates \ + curl \ + openssl \ + tar \ + xz + +# ensure www-data user exists +RUN set -eux; \ + adduser -u 82 -D -S -G www-data www-data +# 82 is the standard uid/gid for "www-data" in Alpine +# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.14-stable +# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable +# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable + +ENV PHP_INI_DIR /usr/local/etc/php +RUN set -eux; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ +# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) + [ ! -d /var/www/html ]; \ + mkdir -p /var/www/html; \ + chown www-data:www-data /var/www/html; \ + chmod 1777 /var/www/html + +# Apply stack smash protection to functions using local buffers and alloca() +# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) +# Enable optimization (-O2) +# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) +# https://github.com/docker-library/php/issues/272 +# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) +ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +ENV PHP_CPPFLAGS="$PHP_CFLAGS" +ENV PHP_LDFLAGS="-Wl,-O1 -pie" + +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E + +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" + +RUN set -eux; \ + \ + apk add --no-cache --virtual .fetch-deps gnupg; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME"; \ + \ + apk del --no-network .fetch-deps + +COPY docker-php-source /usr/local/bin/ + +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + argon2-dev \ + coreutils \ + curl-dev \ + gnu-libiconv-dev \ + libsodium-dev \ + libxml2-dev \ + linux-headers \ + openssl-dev \ + readline-dev \ + sqlite-dev \ + ; \ + \ +# make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) + rm -vf /usr/include/iconv.h; \ + \ + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ +# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 + PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ + PHP_UNAME='Linux - Docker' \ + ; \ + docker-php-source extract; \ + cd /usr/src/php; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ + ./configure \ + --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + \ +# make sure invalid --configure-flags are fatal errors instead of just warnings + --enable-option-checking=fatal \ + \ +# https://github.com/docker-library/php/issues/439 + --with-mhash \ + \ +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 +# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ +# https://wiki.php.net/rfc/argon2_password_hash + --with-password-argon2 \ +# https://wiki.php.net/rfc/libsodium + --with-sodium=shared \ +# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) + --with-pdo-sqlite=/usr \ + --with-sqlite3=/usr \ + \ + --with-curl \ + --with-iconv=/usr \ + --with-openssl \ + --with-readline \ + --with-zlib \ + \ +# https://github.com/bwoebi/phpdbg-docs/issues/1#issuecomment-163872806 ("phpdbg is primarily a CLI debugger, and is not suitable for debugging an fpm stack.") + --disable-phpdbg \ + \ + \ + --disable-cgi \ + \ + --enable-fpm \ + --with-fpm-user=www-data \ + --with-fpm-group=www-data \ + \ + --enable-zts \ +# https://externals.io/message/118859 + --disable-zend-signals \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' + \ + ; \ + make clean; \ + \ +# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) + cp -v php.ini-* "$PHP_INI_DIR/"; \ + \ + cd /; \ + docker-php-source delete; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-cache $runDeps; \ + \ + apk del --no-network .build-deps; \ + \ +# smoke test + php --version + +COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ + +# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) +RUN docker-php-ext-enable sodium + +ENTRYPOINT ["docker-php-entrypoint"] +WORKDIR /var/www/html + +RUN set -eux; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ + { \ + echo '[global]'; \ + echo 'error_log = /proc/self/fd/2'; \ + echo; echo '; https://github.com/docker-library/php/pull/725#issuecomment-443540114'; echo 'log_limit = 8192'; \ + echo; \ + echo '[www]'; \ + echo '; php-fpm closes STDOUT on startup, so sending logs to /proc/self/fd/1 does not work.'; \ + echo '; https://bugs.php.net/bug.php?id=73886'; \ + echo 'access.log = /proc/self/fd/2'; \ + echo; \ + echo 'clear_env = no'; \ + echo; \ + echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ + echo 'catch_workers_output = yes'; \ + echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ + } | tee php-fpm.d/docker.conf; \ + { \ + echo '[global]'; \ + echo 'daemonize = no'; \ + } | tee php-fpm.d/zz-docker.conf; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ + { \ + echo '; https://github.com/docker-library/php/issues/878#issuecomment-938595965'; \ + echo 'fastcgi.logging = Off'; \ + } > "$PHP_INI_DIR/conf.d/docker-fpm.ini" + +# Override stop signal to stop process gracefully +# https://github.com/php/php-src/blob/17baa87faddc2550def3ae7314236826bc1b1398/sapi/fpm/php-fpm.8.in#L163 +STOPSIGNAL SIGQUIT + +EXPOSE 9000 +CMD ["php-fpm"] diff --git a/8.5-rc/alpine3.22/fpm/docker-php-entrypoint b/8.6/alpine3.24/fpm/docker-php-entrypoint similarity index 100% rename from 8.5-rc/alpine3.22/fpm/docker-php-entrypoint rename to 8.6/alpine3.24/fpm/docker-php-entrypoint diff --git a/8.5-rc/alpine3.22/fpm/docker-php-ext-configure b/8.6/alpine3.24/fpm/docker-php-ext-configure similarity index 100% rename from 8.5-rc/alpine3.22/fpm/docker-php-ext-configure rename to 8.6/alpine3.24/fpm/docker-php-ext-configure diff --git a/8.5-rc/alpine3.22/fpm/docker-php-ext-enable b/8.6/alpine3.24/fpm/docker-php-ext-enable similarity index 100% rename from 8.5-rc/alpine3.22/fpm/docker-php-ext-enable rename to 8.6/alpine3.24/fpm/docker-php-ext-enable diff --git a/8.5-rc/alpine3.22/fpm/docker-php-ext-install b/8.6/alpine3.24/fpm/docker-php-ext-install similarity index 100% rename from 8.5-rc/alpine3.22/fpm/docker-php-ext-install rename to 8.6/alpine3.24/fpm/docker-php-ext-install diff --git a/8.5-rc/alpine3.22/fpm/docker-php-source b/8.6/alpine3.24/fpm/docker-php-source similarity index 100% rename from 8.5-rc/alpine3.22/fpm/docker-php-source rename to 8.6/alpine3.24/fpm/docker-php-source diff --git a/8.6/alpine3.24/nts/Dockerfile b/8.6/alpine3.24/nts/Dockerfile new file mode 100644 index 0000000000..e57f4c9e21 --- /dev/null +++ b/8.6/alpine3.24/nts/Dockerfile @@ -0,0 +1,202 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.24 + +# dependencies required for running "phpize" +# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev dpkg \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkgconf \ + re2c + +# persistent / runtime deps +RUN apk add --no-cache \ + ca-certificates \ + curl \ + openssl \ + tar \ + xz + +# ensure www-data user exists +RUN set -eux; \ + adduser -u 82 -D -S -G www-data www-data +# 82 is the standard uid/gid for "www-data" in Alpine +# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.14-stable +# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.14-stable +# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.14-stable + +ENV PHP_INI_DIR /usr/local/etc/php +RUN set -eux; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ +# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) + [ ! -d /var/www/html ]; \ + mkdir -p /var/www/html; \ + chown www-data:www-data /var/www/html; \ + chmod 1777 /var/www/html + +# Apply stack smash protection to functions using local buffers and alloca() +# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) +# Enable optimization (-O2) +# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) +# https://github.com/docker-library/php/issues/272 +# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) +ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +ENV PHP_CPPFLAGS="$PHP_CFLAGS" +ENV PHP_LDFLAGS="-Wl,-O1 -pie" + +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E + +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" + +RUN set -eux; \ + \ + apk add --no-cache --virtual .fetch-deps gnupg; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME"; \ + \ + apk del --no-network .fetch-deps + +COPY docker-php-source /usr/local/bin/ + +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + argon2-dev \ + coreutils \ + curl-dev \ + gnu-libiconv-dev \ + libsodium-dev \ + libxml2-dev \ + linux-headers \ + openssl-dev \ + readline-dev \ + sqlite-dev \ + ; \ + \ +# make sure musl's iconv doesn't get used (https://www.php.net/manual/en/intro.iconv.php) + rm -vf /usr/include/iconv.h; \ + \ + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ +# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 + PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ + PHP_UNAME='Linux - Docker' \ + ; \ + docker-php-source extract; \ + cd /usr/src/php; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ + ./configure \ + --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + \ +# make sure invalid --configure-flags are fatal errors instead of just warnings + --enable-option-checking=fatal \ + \ +# https://github.com/docker-library/php/issues/439 + --with-mhash \ + \ +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 +# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ +# https://wiki.php.net/rfc/argon2_password_hash + --with-password-argon2 \ +# https://wiki.php.net/rfc/libsodium + --with-sodium=shared \ +# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) + --with-pdo-sqlite=/usr \ + --with-sqlite3=/usr \ + \ + --with-curl \ + --with-iconv=/usr \ + --with-openssl \ + --with-readline \ + --with-zlib \ + \ +# https://github.com/docker-library/php/pull/1259 + --enable-phpdbg \ + --enable-phpdbg-readline \ + \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' + \ + ; \ + make clean; \ + \ +# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) + cp -v php.ini-* "$PHP_INI_DIR/"; \ + \ + cd /; \ + docker-php-source delete; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-cache $runDeps; \ + \ + apk del --no-network .build-deps; \ + \ +# smoke test + php --version + +COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ + +# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) +RUN docker-php-ext-enable sodium + +ENTRYPOINT ["docker-php-entrypoint"] +CMD ["php", "-a"] diff --git a/8.5-rc/alpine3.22/zts/docker-php-entrypoint b/8.6/alpine3.24/nts/docker-php-entrypoint similarity index 100% rename from 8.5-rc/alpine3.22/zts/docker-php-entrypoint rename to 8.6/alpine3.24/nts/docker-php-entrypoint diff --git a/8.5-rc/alpine3.22/zts/docker-php-ext-configure b/8.6/alpine3.24/nts/docker-php-ext-configure similarity index 100% rename from 8.5-rc/alpine3.22/zts/docker-php-ext-configure rename to 8.6/alpine3.24/nts/docker-php-ext-configure diff --git a/8.5-rc/alpine3.22/zts/docker-php-ext-enable b/8.6/alpine3.24/nts/docker-php-ext-enable similarity index 100% rename from 8.5-rc/alpine3.22/zts/docker-php-ext-enable rename to 8.6/alpine3.24/nts/docker-php-ext-enable diff --git a/8.5-rc/alpine3.22/zts/docker-php-ext-install b/8.6/alpine3.24/nts/docker-php-ext-install similarity index 100% rename from 8.5-rc/alpine3.22/zts/docker-php-ext-install rename to 8.6/alpine3.24/nts/docker-php-ext-install diff --git a/8.5-rc/alpine3.22/zts/docker-php-source b/8.6/alpine3.24/nts/docker-php-source similarity index 100% rename from 8.5-rc/alpine3.22/zts/docker-php-source rename to 8.6/alpine3.24/nts/docker-php-source diff --git a/8.1/bookworm/apache/Dockerfile b/8.6/bookworm/apache/Dockerfile similarity index 85% rename from 8.1/bookworm/apache/Dockerfile rename to 8.6/bookworm/apache/Dockerfile index 1bb1d46384..f7994b9663 100644 --- a/8.1/bookworm/apache/Dockerfile +++ b/8.6/bookworm/apache/Dockerfile @@ -118,11 +118,11 @@ ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_ ENV PHP_CPPFLAGS="$PHP_CFLAGS" ENV PHP_LDFLAGS="-Wl,-O1 -pie" -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" RUN set -eux; \ \ @@ -163,7 +163,6 @@ RUN set -eux; \ apache2-dev \ libargon2-dev \ libcurl4-openssl-dev \ - libonig-dev \ libreadline-dev \ libsodium-dev \ libsqlite3-dev \ @@ -188,8 +187,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -200,12 +212,9 @@ RUN set -eux; \ --with-mhash \ \ # https://github.com/docker-library/php/issues/822 - --with-pic \ +# https://github.com/php/php-src/pull/21067/changes#diff-4b9db5b77bcd56aa33b310dc44c8bc99c729c9abb195df2e98e6985b81289ae8R130 + --enable-pic \ \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ # --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) --enable-mysqlnd \ # https://wiki.php.net/rfc/argon2_password_hash @@ -225,18 +234,15 @@ RUN set -eux; \ # https://github.com/bwoebi/phpdbg-docs/issues/1#issuecomment-163872806 ("phpdbg is primarily a CLI debugger, and is not suitable for debugging an fpm stack.") --disable-phpdbg \ \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ --disable-cgi \ \ --with-apxs2 \ + \ + --enable-zts \ +# https://externals.io/message/118859 + --disable-zend-signals \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ @@ -272,18 +278,11 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ # smoke test php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/8.5-rc/bookworm/apache/apache2-foreground b/8.6/bookworm/apache/apache2-foreground similarity index 100% rename from 8.5-rc/bookworm/apache/apache2-foreground rename to 8.6/bookworm/apache/apache2-foreground diff --git a/8.5-rc/bookworm/apache/docker-php-entrypoint b/8.6/bookworm/apache/docker-php-entrypoint similarity index 100% rename from 8.5-rc/bookworm/apache/docker-php-entrypoint rename to 8.6/bookworm/apache/docker-php-entrypoint diff --git a/8.5-rc/bookworm/apache/docker-php-ext-configure b/8.6/bookworm/apache/docker-php-ext-configure similarity index 100% rename from 8.5-rc/bookworm/apache/docker-php-ext-configure rename to 8.6/bookworm/apache/docker-php-ext-configure diff --git a/8.5-rc/bookworm/apache/docker-php-ext-enable b/8.6/bookworm/apache/docker-php-ext-enable similarity index 100% rename from 8.5-rc/bookworm/apache/docker-php-ext-enable rename to 8.6/bookworm/apache/docker-php-ext-enable diff --git a/8.5-rc/bookworm/apache/docker-php-ext-install b/8.6/bookworm/apache/docker-php-ext-install similarity index 100% rename from 8.5-rc/bookworm/apache/docker-php-ext-install rename to 8.6/bookworm/apache/docker-php-ext-install diff --git a/8.5-rc/bookworm/apache/docker-php-source b/8.6/bookworm/apache/docker-php-source similarity index 100% rename from 8.5-rc/bookworm/apache/docker-php-source rename to 8.6/bookworm/apache/docker-php-source diff --git a/8.6/bookworm/cli/Dockerfile b/8.6/bookworm/cli/Dockerfile new file mode 100644 index 0000000000..ff93ab09ec --- /dev/null +++ b/8.6/bookworm/cli/Dockerfile @@ -0,0 +1,226 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bookworm-slim + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV PHP_INI_DIR /usr/local/etc/php +RUN set -eux; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ +# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) + [ ! -d /var/www/html ]; \ + mkdir -p /var/www/html; \ + chown www-data:www-data /var/www/html; \ + chmod 1777 /var/www/html + +# Apply stack smash protection to functions using local buffers and alloca() +# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) +# Enable optimization (-O2) +# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) +# https://github.com/docker-library/php/issues/272 +# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) +ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +ENV PHP_CPPFLAGS="$PHP_CFLAGS" +ENV PHP_LDFLAGS="-Wl,-O1 -pie" + +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E + +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME"; \ + \ + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark > /dev/null; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false + +COPY docker-php-source /usr/local/bin/ + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libargon2-dev \ + libcurl4-openssl-dev \ + libreadline-dev \ + libsodium-dev \ + libsqlite3-dev \ + libssl-dev \ + libxml2-dev \ + zlib1g-dev \ + ; \ + \ + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ +# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 + PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ + PHP_UNAME='Linux - Docker' \ + ; \ + docker-php-source extract; \ + cd /usr/src/php; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ +# https://bugs.php.net/bug.php?id=74125 + if [ ! -d /usr/include/curl ]; then \ + ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ + fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ + ./configure \ + --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + \ +# make sure invalid --configure-flags are fatal errors instead of just warnings + --enable-option-checking=fatal \ + \ +# https://github.com/docker-library/php/issues/439 + --with-mhash \ + \ +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 +# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ +# https://wiki.php.net/rfc/argon2_password_hash + --with-password-argon2 \ +# https://wiki.php.net/rfc/libsodium + --with-sodium=shared \ +# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) + --with-pdo-sqlite=/usr \ + --with-sqlite3=/usr \ + \ + --with-curl \ + --with-iconv \ + --with-openssl \ + --with-readline \ + --with-zlib \ + \ +# https://github.com/docker-library/php/pull/1259 + --enable-phpdbg \ + --enable-phpdbg-readline \ + \ + --with-libdir="lib/$debMultiarch" \ + \ +# https://github.com/docker-library/php/pull/939#issuecomment-730501748 + --enable-embed \ + \ + --enable-zts \ +# https://externals.io/message/118859 + --disable-zend-signals \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' + \ + ; \ + make clean; \ + \ +# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) + cp -v php.ini-* "$PHP_INI_DIR/"; \ + \ + cd /; \ + docker-php-source delete; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -rt dpkg-query --search \ +# https://manpages.debian.org/trixie/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file) + | awk 'sub(":$", "", $1) { print $1 }' \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# smoke test + php --version + +COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ + +# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) +RUN docker-php-ext-enable sodium + +ENTRYPOINT ["docker-php-entrypoint"] +CMD ["php", "-a"] diff --git a/8.5-rc/bookworm/cli/docker-php-entrypoint b/8.6/bookworm/cli/docker-php-entrypoint similarity index 100% rename from 8.5-rc/bookworm/cli/docker-php-entrypoint rename to 8.6/bookworm/cli/docker-php-entrypoint diff --git a/8.5-rc/bookworm/cli/docker-php-ext-configure b/8.6/bookworm/cli/docker-php-ext-configure similarity index 100% rename from 8.5-rc/bookworm/cli/docker-php-ext-configure rename to 8.6/bookworm/cli/docker-php-ext-configure diff --git a/8.5-rc/bookworm/cli/docker-php-ext-enable b/8.6/bookworm/cli/docker-php-ext-enable similarity index 100% rename from 8.5-rc/bookworm/cli/docker-php-ext-enable rename to 8.6/bookworm/cli/docker-php-ext-enable diff --git a/8.5-rc/bookworm/cli/docker-php-ext-install b/8.6/bookworm/cli/docker-php-ext-install similarity index 100% rename from 8.5-rc/bookworm/cli/docker-php-ext-install rename to 8.6/bookworm/cli/docker-php-ext-install diff --git a/8.5-rc/bookworm/cli/docker-php-source b/8.6/bookworm/cli/docker-php-source similarity index 100% rename from 8.5-rc/bookworm/cli/docker-php-source rename to 8.6/bookworm/cli/docker-php-source diff --git a/8.1/bookworm/fpm/Dockerfile b/8.6/bookworm/fpm/Dockerfile similarity index 77% rename from 8.1/bookworm/fpm/Dockerfile rename to 8.6/bookworm/fpm/Dockerfile index 97421c9048..88666162bf 100644 --- a/8.1/bookworm/fpm/Dockerfile +++ b/8.6/bookworm/fpm/Dockerfile @@ -58,11 +58,11 @@ ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_ ENV PHP_CPPFLAGS="$PHP_CFLAGS" ENV PHP_LDFLAGS="-Wl,-O1 -pie" -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" RUN set -eux; \ \ @@ -102,7 +102,6 @@ RUN set -eux; \ apt-get install -y --no-install-recommends \ libargon2-dev \ libcurl4-openssl-dev \ - libonig-dev \ libreadline-dev \ libsodium-dev \ libsqlite3-dev \ @@ -127,8 +126,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -138,13 +150,7 @@ RUN set -eux; \ # https://github.com/docker-library/php/issues/439 --with-mhash \ \ -# https://github.com/docker-library/php/issues/822 - --with-pic \ - \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 # --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) --enable-mysqlnd \ # https://wiki.php.net/rfc/argon2_password_hash @@ -164,13 +170,6 @@ RUN set -eux; \ # https://github.com/bwoebi/phpdbg-docs/issues/1#issuecomment-163872806 ("phpdbg is primarily a CLI debugger, and is not suitable for debugging an fpm stack.") --disable-phpdbg \ \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ --disable-cgi \ @@ -178,6 +177,10 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + \ + --enable-zts \ +# https://externals.io/message/118859 + --disable-zend-signals \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ @@ -213,18 +216,11 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ rm -rf /var/lib/apt/lists/*; \ \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ # smoke test php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium @@ -232,20 +228,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -261,13 +253,13 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ - echo; \ - echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.5-rc/bookworm/fpm/docker-php-entrypoint b/8.6/bookworm/fpm/docker-php-entrypoint similarity index 100% rename from 8.5-rc/bookworm/fpm/docker-php-entrypoint rename to 8.6/bookworm/fpm/docker-php-entrypoint diff --git a/8.5-rc/bookworm/fpm/docker-php-ext-configure b/8.6/bookworm/fpm/docker-php-ext-configure similarity index 100% rename from 8.5-rc/bookworm/fpm/docker-php-ext-configure rename to 8.6/bookworm/fpm/docker-php-ext-configure diff --git a/8.5-rc/bookworm/fpm/docker-php-ext-enable b/8.6/bookworm/fpm/docker-php-ext-enable similarity index 100% rename from 8.5-rc/bookworm/fpm/docker-php-ext-enable rename to 8.6/bookworm/fpm/docker-php-ext-enable diff --git a/8.5-rc/bookworm/fpm/docker-php-ext-install b/8.6/bookworm/fpm/docker-php-ext-install similarity index 100% rename from 8.5-rc/bookworm/fpm/docker-php-ext-install rename to 8.6/bookworm/fpm/docker-php-ext-install diff --git a/8.5-rc/bookworm/fpm/docker-php-source b/8.6/bookworm/fpm/docker-php-source similarity index 100% rename from 8.5-rc/bookworm/fpm/docker-php-source rename to 8.6/bookworm/fpm/docker-php-source diff --git a/8.6/bookworm/nts/Dockerfile b/8.6/bookworm/nts/Dockerfile new file mode 100644 index 0000000000..032aa5fb7d --- /dev/null +++ b/8.6/bookworm/nts/Dockerfile @@ -0,0 +1,219 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bookworm-slim + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV PHP_INI_DIR /usr/local/etc/php +RUN set -eux; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ +# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) + [ ! -d /var/www/html ]; \ + mkdir -p /var/www/html; \ + chown www-data:www-data /var/www/html; \ + chmod 1777 /var/www/html + +# Apply stack smash protection to functions using local buffers and alloca() +# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) +# Enable optimization (-O2) +# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) +# https://github.com/docker-library/php/issues/272 +# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) +ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +ENV PHP_CPPFLAGS="$PHP_CFLAGS" +ENV PHP_LDFLAGS="-Wl,-O1 -pie" + +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E + +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg; \ + rm -rf /var/lib/apt/lists/*; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME"; \ + \ + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark > /dev/null; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false + +COPY docker-php-source /usr/local/bin/ + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libargon2-dev \ + libcurl4-openssl-dev \ + libreadline-dev \ + libsodium-dev \ + libsqlite3-dev \ + libssl-dev \ + libxml2-dev \ + zlib1g-dev \ + ; \ + \ + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ +# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 + PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ + PHP_UNAME='Linux - Docker' \ + ; \ + docker-php-source extract; \ + cd /usr/src/php; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ +# https://bugs.php.net/bug.php?id=74125 + if [ ! -d /usr/include/curl ]; then \ + ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ + fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ + ./configure \ + --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + \ +# make sure invalid --configure-flags are fatal errors instead of just warnings + --enable-option-checking=fatal \ + \ +# https://github.com/docker-library/php/issues/439 + --with-mhash \ + \ +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 +# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ +# https://wiki.php.net/rfc/argon2_password_hash + --with-password-argon2 \ +# https://wiki.php.net/rfc/libsodium + --with-sodium=shared \ +# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) + --with-pdo-sqlite=/usr \ + --with-sqlite3=/usr \ + \ + --with-curl \ + --with-iconv \ + --with-openssl \ + --with-readline \ + --with-zlib \ + \ +# https://github.com/docker-library/php/pull/1259 + --enable-phpdbg \ + --enable-phpdbg-readline \ + \ + --with-libdir="lib/$debMultiarch" \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' + \ + ; \ + make clean; \ + \ +# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) + cp -v php.ini-* "$PHP_INI_DIR/"; \ + \ + cd /; \ + docker-php-source delete; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -rt dpkg-query --search \ +# https://manpages.debian.org/trixie/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file) + | awk 'sub(":$", "", $1) { print $1 }' \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# smoke test + php --version + +COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ + +# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) +RUN docker-php-ext-enable sodium + +ENTRYPOINT ["docker-php-entrypoint"] +CMD ["php", "-a"] diff --git a/8.5-rc/bookworm/zts/docker-php-entrypoint b/8.6/bookworm/nts/docker-php-entrypoint similarity index 100% rename from 8.5-rc/bookworm/zts/docker-php-entrypoint rename to 8.6/bookworm/nts/docker-php-entrypoint diff --git a/8.5-rc/bookworm/zts/docker-php-ext-configure b/8.6/bookworm/nts/docker-php-ext-configure similarity index 100% rename from 8.5-rc/bookworm/zts/docker-php-ext-configure rename to 8.6/bookworm/nts/docker-php-ext-configure diff --git a/8.5-rc/bookworm/zts/docker-php-ext-enable b/8.6/bookworm/nts/docker-php-ext-enable similarity index 100% rename from 8.5-rc/bookworm/zts/docker-php-ext-enable rename to 8.6/bookworm/nts/docker-php-ext-enable diff --git a/8.5-rc/bookworm/zts/docker-php-ext-install b/8.6/bookworm/nts/docker-php-ext-install similarity index 100% rename from 8.5-rc/bookworm/zts/docker-php-ext-install rename to 8.6/bookworm/nts/docker-php-ext-install diff --git a/8.5-rc/bookworm/zts/docker-php-source b/8.6/bookworm/nts/docker-php-source similarity index 100% rename from 8.5-rc/bookworm/zts/docker-php-source rename to 8.6/bookworm/nts/docker-php-source diff --git a/8.1/trixie/apache/Dockerfile b/8.6/trixie/apache/Dockerfile similarity index 85% rename from 8.1/trixie/apache/Dockerfile rename to 8.6/trixie/apache/Dockerfile index a3dfec4f99..f394b55959 100644 --- a/8.1/trixie/apache/Dockerfile +++ b/8.6/trixie/apache/Dockerfile @@ -118,11 +118,11 @@ ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_ ENV PHP_CPPFLAGS="$PHP_CFLAGS" ENV PHP_LDFLAGS="-Wl,-O1 -pie" -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" RUN set -eux; \ \ @@ -163,7 +163,6 @@ RUN set -eux; \ apache2-dev \ libargon2-dev \ libcurl4-openssl-dev \ - libonig-dev \ libreadline-dev \ libsodium-dev \ libsqlite3-dev \ @@ -188,8 +187,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -200,12 +212,9 @@ RUN set -eux; \ --with-mhash \ \ # https://github.com/docker-library/php/issues/822 - --with-pic \ +# https://github.com/php/php-src/pull/21067/changes#diff-4b9db5b77bcd56aa33b310dc44c8bc99c729c9abb195df2e98e6985b81289ae8R130 + --enable-pic \ \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ # --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) --enable-mysqlnd \ # https://wiki.php.net/rfc/argon2_password_hash @@ -225,18 +234,15 @@ RUN set -eux; \ # https://github.com/bwoebi/phpdbg-docs/issues/1#issuecomment-163872806 ("phpdbg is primarily a CLI debugger, and is not suitable for debugging an fpm stack.") --disable-phpdbg \ \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ --disable-cgi \ \ --with-apxs2 \ + \ + --enable-zts \ +# https://externals.io/message/118859 + --disable-zend-signals \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ @@ -272,18 +278,11 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ apt-get dist-clean; \ \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ # smoke test php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/8.5-rc/trixie/apache/apache2-foreground b/8.6/trixie/apache/apache2-foreground similarity index 100% rename from 8.5-rc/trixie/apache/apache2-foreground rename to 8.6/trixie/apache/apache2-foreground diff --git a/8.5-rc/trixie/apache/docker-php-entrypoint b/8.6/trixie/apache/docker-php-entrypoint similarity index 100% rename from 8.5-rc/trixie/apache/docker-php-entrypoint rename to 8.6/trixie/apache/docker-php-entrypoint diff --git a/8.5-rc/trixie/apache/docker-php-ext-configure b/8.6/trixie/apache/docker-php-ext-configure similarity index 100% rename from 8.5-rc/trixie/apache/docker-php-ext-configure rename to 8.6/trixie/apache/docker-php-ext-configure diff --git a/8.5-rc/trixie/apache/docker-php-ext-enable b/8.6/trixie/apache/docker-php-ext-enable similarity index 100% rename from 8.5-rc/trixie/apache/docker-php-ext-enable rename to 8.6/trixie/apache/docker-php-ext-enable diff --git a/8.5-rc/trixie/apache/docker-php-ext-install b/8.6/trixie/apache/docker-php-ext-install similarity index 100% rename from 8.5-rc/trixie/apache/docker-php-ext-install rename to 8.6/trixie/apache/docker-php-ext-install diff --git a/8.5-rc/trixie/apache/docker-php-source b/8.6/trixie/apache/docker-php-source similarity index 100% rename from 8.5-rc/trixie/apache/docker-php-source rename to 8.6/trixie/apache/docker-php-source diff --git a/8.6/trixie/cli/Dockerfile b/8.6/trixie/cli/Dockerfile new file mode 100644 index 0000000000..87fd5ffa63 --- /dev/null +++ b/8.6/trixie/cli/Dockerfile @@ -0,0 +1,226 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:trixie-slim + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + ; \ + apt-get dist-clean + +ENV PHP_INI_DIR /usr/local/etc/php +RUN set -eux; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ +# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) + [ ! -d /var/www/html ]; \ + mkdir -p /var/www/html; \ + chown www-data:www-data /var/www/html; \ + chmod 1777 /var/www/html + +# Apply stack smash protection to functions using local buffers and alloca() +# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) +# Enable optimization (-O2) +# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) +# https://github.com/docker-library/php/issues/272 +# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) +ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +ENV PHP_CPPFLAGS="$PHP_CFLAGS" +ENV PHP_LDFLAGS="-Wl,-O1 -pie" + +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E + +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg; \ + apt-get dist-clean; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME"; \ + \ + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark > /dev/null; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false + +COPY docker-php-source /usr/local/bin/ + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libargon2-dev \ + libcurl4-openssl-dev \ + libreadline-dev \ + libsodium-dev \ + libsqlite3-dev \ + libssl-dev \ + libxml2-dev \ + zlib1g-dev \ + ; \ + \ + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ +# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 + PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ + PHP_UNAME='Linux - Docker' \ + ; \ + docker-php-source extract; \ + cd /usr/src/php; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ +# https://bugs.php.net/bug.php?id=74125 + if [ ! -d /usr/include/curl ]; then \ + ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ + fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ + ./configure \ + --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + \ +# make sure invalid --configure-flags are fatal errors instead of just warnings + --enable-option-checking=fatal \ + \ +# https://github.com/docker-library/php/issues/439 + --with-mhash \ + \ +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 +# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ +# https://wiki.php.net/rfc/argon2_password_hash + --with-password-argon2 \ +# https://wiki.php.net/rfc/libsodium + --with-sodium=shared \ +# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) + --with-pdo-sqlite=/usr \ + --with-sqlite3=/usr \ + \ + --with-curl \ + --with-iconv \ + --with-openssl \ + --with-readline \ + --with-zlib \ + \ +# https://github.com/docker-library/php/pull/1259 + --enable-phpdbg \ + --enable-phpdbg-readline \ + \ + --with-libdir="lib/$debMultiarch" \ + \ +# https://github.com/docker-library/php/pull/939#issuecomment-730501748 + --enable-embed \ + \ + --enable-zts \ +# https://externals.io/message/118859 + --disable-zend-signals \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' + \ + ; \ + make clean; \ + \ +# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) + cp -v php.ini-* "$PHP_INI_DIR/"; \ + \ + cd /; \ + docker-php-source delete; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -rt dpkg-query --search \ +# https://manpages.debian.org/trixie/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file) + | awk 'sub(":$", "", $1) { print $1 }' \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + apt-get dist-clean; \ + \ +# smoke test + php --version + +COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ + +# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) +RUN docker-php-ext-enable sodium + +ENTRYPOINT ["docker-php-entrypoint"] +CMD ["php", "-a"] diff --git a/8.5-rc/trixie/cli/docker-php-entrypoint b/8.6/trixie/cli/docker-php-entrypoint similarity index 100% rename from 8.5-rc/trixie/cli/docker-php-entrypoint rename to 8.6/trixie/cli/docker-php-entrypoint diff --git a/8.5-rc/trixie/cli/docker-php-ext-configure b/8.6/trixie/cli/docker-php-ext-configure similarity index 100% rename from 8.5-rc/trixie/cli/docker-php-ext-configure rename to 8.6/trixie/cli/docker-php-ext-configure diff --git a/8.5-rc/trixie/cli/docker-php-ext-enable b/8.6/trixie/cli/docker-php-ext-enable similarity index 100% rename from 8.5-rc/trixie/cli/docker-php-ext-enable rename to 8.6/trixie/cli/docker-php-ext-enable diff --git a/8.5-rc/trixie/cli/docker-php-ext-install b/8.6/trixie/cli/docker-php-ext-install similarity index 100% rename from 8.5-rc/trixie/cli/docker-php-ext-install rename to 8.6/trixie/cli/docker-php-ext-install diff --git a/8.5-rc/trixie/cli/docker-php-source b/8.6/trixie/cli/docker-php-source similarity index 100% rename from 8.5-rc/trixie/cli/docker-php-source rename to 8.6/trixie/cli/docker-php-source diff --git a/8.1/trixie/fpm/Dockerfile b/8.6/trixie/fpm/Dockerfile similarity index 77% rename from 8.1/trixie/fpm/Dockerfile rename to 8.6/trixie/fpm/Dockerfile index af842f2eb0..3b79df7127 100644 --- a/8.1/trixie/fpm/Dockerfile +++ b/8.6/trixie/fpm/Dockerfile @@ -58,11 +58,11 @@ ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_ ENV PHP_CPPFLAGS="$PHP_CFLAGS" ENV PHP_LDFLAGS="-Wl,-O1 -pie" -ENV GPG_KEYS 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E -ENV PHP_VERSION 8.1.33 -ENV PHP_URL="https://www.php.net/distributions/php-8.1.33.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.1.33.tar.xz.asc" -ENV PHP_SHA256="9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1" +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" RUN set -eux; \ \ @@ -102,7 +102,6 @@ RUN set -eux; \ apt-get install -y --no-install-recommends \ libargon2-dev \ libcurl4-openssl-dev \ - libonig-dev \ libreadline-dev \ libsodium-dev \ libsqlite3-dev \ @@ -127,8 +126,21 @@ RUN set -eux; \ if [ ! -d /usr/include/curl ]; then \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -138,13 +150,7 @@ RUN set -eux; \ # https://github.com/docker-library/php/issues/439 --with-mhash \ \ -# https://github.com/docker-library/php/issues/822 - --with-pic \ - \ -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 # --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) --enable-mysqlnd \ # https://wiki.php.net/rfc/argon2_password_hash @@ -164,13 +170,6 @@ RUN set -eux; \ # https://github.com/bwoebi/phpdbg-docs/issues/1#issuecomment-163872806 ("phpdbg is primarily a CLI debugger, and is not suitable for debugging an fpm stack.") --disable-phpdbg \ \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") - --with-pear \ - \ -# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) -# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c -# https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib - $(test "$gnuArch" = 'riscv64-linux-gnu' && echo '--without-pcre-jit') \ --with-libdir="lib/$debMultiarch" \ \ --disable-cgi \ @@ -178,6 +177,10 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ + \ + --enable-zts \ +# https://externals.io/message/118859 + --disable-zend-signals \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ @@ -213,18 +216,11 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ apt-get dist-clean; \ \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ - \ # smoke test php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ -# enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) -RUN docker-php-ext-enable opcache - # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium @@ -232,20 +228,16 @@ ENTRYPOINT ["docker-php-entrypoint"] WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -261,13 +253,13 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ - echo; \ - echo '[www]'; \ - echo 'listen = 9000'; \ } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/8.5-rc/trixie/fpm/docker-php-entrypoint b/8.6/trixie/fpm/docker-php-entrypoint similarity index 100% rename from 8.5-rc/trixie/fpm/docker-php-entrypoint rename to 8.6/trixie/fpm/docker-php-entrypoint diff --git a/8.5-rc/trixie/fpm/docker-php-ext-configure b/8.6/trixie/fpm/docker-php-ext-configure similarity index 100% rename from 8.5-rc/trixie/fpm/docker-php-ext-configure rename to 8.6/trixie/fpm/docker-php-ext-configure diff --git a/8.5-rc/trixie/fpm/docker-php-ext-enable b/8.6/trixie/fpm/docker-php-ext-enable similarity index 100% rename from 8.5-rc/trixie/fpm/docker-php-ext-enable rename to 8.6/trixie/fpm/docker-php-ext-enable diff --git a/8.5-rc/trixie/fpm/docker-php-ext-install b/8.6/trixie/fpm/docker-php-ext-install similarity index 100% rename from 8.5-rc/trixie/fpm/docker-php-ext-install rename to 8.6/trixie/fpm/docker-php-ext-install diff --git a/8.5-rc/trixie/fpm/docker-php-source b/8.6/trixie/fpm/docker-php-source similarity index 100% rename from 8.5-rc/trixie/fpm/docker-php-source rename to 8.6/trixie/fpm/docker-php-source diff --git a/8.6/trixie/nts/Dockerfile b/8.6/trixie/nts/Dockerfile new file mode 100644 index 0000000000..3ad6f5ef1f --- /dev/null +++ b/8.6/trixie/nts/Dockerfile @@ -0,0 +1,219 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:trixie-slim + +# prevent Debian's PHP packages from being installed +# https://github.com/docker-library/php/pull/542 +RUN set -eux; \ + { \ + echo 'Package: php*'; \ + echo 'Pin: release *'; \ + echo 'Pin-Priority: -1'; \ + } > /etc/apt/preferences.d/no-debian-php + +# dependencies required for running "phpize" +# (see persistent deps below) +ENV PHPIZE_DEPS \ + autoconf \ + dpkg-dev \ + file \ + g++ \ + gcc \ + libc-dev \ + make \ + pkg-config \ + re2c + +# persistent / runtime deps +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + $PHPIZE_DEPS \ + ca-certificates \ + curl \ + xz-utils \ + ; \ + apt-get dist-clean + +ENV PHP_INI_DIR /usr/local/etc/php +RUN set -eux; \ + mkdir -p "$PHP_INI_DIR/conf.d"; \ +# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) + [ ! -d /var/www/html ]; \ + mkdir -p /var/www/html; \ + chown www-data:www-data /var/www/html; \ + chmod 1777 /var/www/html + +# Apply stack smash protection to functions using local buffers and alloca() +# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) +# Enable optimization (-O2) +# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) +# https://github.com/docker-library/php/issues/272 +# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) +ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +ENV PHP_CPPFLAGS="$PHP_CFLAGS" +ENV PHP_LDFLAGS="-Wl,-O1 -pie" + +ENV GPG_KEYS D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E + +ENV PHP_VERSION 8.6.0 +ENV PHP_URL="https://www.php.net/distributions/php-8.6.0.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-8.6.0.tar.xz.asc" +ENV PHP_SHA256="5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087" + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg; \ + apt-get dist-clean; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME"; \ + \ + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark > /dev/null; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false + +COPY docker-php-source /usr/local/bin/ + +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libargon2-dev \ + libcurl4-openssl-dev \ + libreadline-dev \ + libsodium-dev \ + libsqlite3-dev \ + libssl-dev \ + libxml2-dev \ + zlib1g-dev \ + ; \ + \ + export \ + CFLAGS="$PHP_CFLAGS" \ + CPPFLAGS="$PHP_CPPFLAGS" \ + LDFLAGS="$PHP_LDFLAGS" \ +# https://github.com/php/php-src/blob/d6299206dd828382753453befd1b915491b741c6/configure.ac#L1496-L1511 + PHP_BUILD_PROVIDER='https://github.com/docker-library/php' \ + PHP_UNAME='Linux - Docker' \ + ; \ + docker-php-source extract; \ + cd /usr/src/php; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ +# https://bugs.php.net/bug.php?id=74125 + if [ ! -d /usr/include/curl ]; then \ + ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ + fi; \ + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ + ./configure \ + --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ + --with-config-file-path="$PHP_INI_DIR" \ + --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ + \ +# make sure invalid --configure-flags are fatal errors instead of just warnings + --enable-option-checking=fatal \ + \ +# https://github.com/docker-library/php/issues/439 + --with-mhash \ + \ +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 +# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) + --enable-mysqlnd \ +# https://wiki.php.net/rfc/argon2_password_hash + --with-password-argon2 \ +# https://wiki.php.net/rfc/libsodium + --with-sodium=shared \ +# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) + --with-pdo-sqlite=/usr \ + --with-sqlite3=/usr \ + \ + --with-curl \ + --with-iconv \ + --with-openssl \ + --with-readline \ + --with-zlib \ + \ +# https://github.com/docker-library/php/pull/1259 + --enable-phpdbg \ + --enable-phpdbg-readline \ + \ + --with-libdir="lib/$debMultiarch" \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + find \ + /usr/local \ + -type f \ + -perm '/0111' \ + -exec sh -euxc ' \ + strip --strip-all "$@" || : \ + ' -- '{}' + \ + ; \ + make clean; \ + \ +# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) + cp -v php.ini-* "$PHP_INI_DIR/"; \ + \ + cd /; \ + docker-php-source delete; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + find /usr/local -type f -executable -exec ldd '{}' ';' \ + | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ + | sort -u \ + | xargs -rt dpkg-query --search \ +# https://manpages.debian.org/trixie/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file) + | awk 'sub(":$", "", $1) { print $1 }' \ + | sort -u \ + | xargs -r apt-mark manual \ + ; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + apt-get dist-clean; \ + \ +# smoke test + php --version + +COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ + +# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) +RUN docker-php-ext-enable sodium + +ENTRYPOINT ["docker-php-entrypoint"] +CMD ["php", "-a"] diff --git a/8.5-rc/trixie/zts/docker-php-entrypoint b/8.6/trixie/nts/docker-php-entrypoint similarity index 100% rename from 8.5-rc/trixie/zts/docker-php-entrypoint rename to 8.6/trixie/nts/docker-php-entrypoint diff --git a/8.5-rc/trixie/zts/docker-php-ext-configure b/8.6/trixie/nts/docker-php-ext-configure similarity index 100% rename from 8.5-rc/trixie/zts/docker-php-ext-configure rename to 8.6/trixie/nts/docker-php-ext-configure diff --git a/8.5-rc/trixie/zts/docker-php-ext-enable b/8.6/trixie/nts/docker-php-ext-enable similarity index 100% rename from 8.5-rc/trixie/zts/docker-php-ext-enable rename to 8.6/trixie/nts/docker-php-ext-enable diff --git a/8.5-rc/trixie/zts/docker-php-ext-install b/8.6/trixie/nts/docker-php-ext-install similarity index 100% rename from 8.5-rc/trixie/zts/docker-php-ext-install rename to 8.6/trixie/nts/docker-php-ext-install diff --git a/8.5-rc/trixie/zts/docker-php-source b/8.6/trixie/nts/docker-php-source similarity index 100% rename from 8.5-rc/trixie/zts/docker-php-source rename to 8.6/trixie/nts/docker-php-source diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index 38d3f12a4b..b59df6bbbe 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -22,19 +22,16 @@ "rm -rf /var/lib/apt/lists/*" else "apt-get dist-clean" end ; - def need_patch_11678: - # https://github.com/docker-library/php/pull/1552 - # https://github.com/php/php-src/issues/11678 "Build fails on musl 1.2.4 - lfs64" stream_cookie_seeker - # https://github.com/php/php-src/issues/14834 "Error installing PHP when --with-pear is used" xml errors - is_alpine and rcVersion == "8.1" - ; def need_patch_18743: # https://github.com/docker-library/php/pull/1580 # https://github.com/php/php-src/issues/18743 "Incompatibility in Inline TLS Assembly on Alpine 3.22 with zend_jit_ir.c" - env.variant == "zts" # only needed for ZTS builds + env.variant == "zts" and is_alpine - and env.from != "alpine:3.21" # only needed for Alpine 3.22+ - and IN(rcVersion; "8.1", "8.2") + and IN(rcVersion; "8.2") + ; + def install_pear_pecl: + # https://github.com/docker-library/php/issues/1554 + IN(rcVersion; "8.2", "8.3", "8.4", "8.5") -}} FROM {{ env.from }} @@ -180,6 +177,14 @@ ENV GPG_KEYS {{ # https://www.php.net/gpg-keys.php # https://www.php.net/downloads.php + "8.6": [ + # https://wiki.php.net/todo/php86#release_managers + # https://www.php.net/gpg-keys.php#gpg-8.6 + "D95C 03BC 702B E951 5344 AE33 74E4 4BC9 0677 01A5", # daniels + "0168 95DE 9A47 5111 D537 A6E6 9134 FF30 BC5A 99B5", # mbeccati + "5CFF 17B6 4DC1 C244 F5D0 EAC3 E435 35E2 EB19 010E" # svpernova09 + ], + "8.5": [ # https://wiki.php.net/todo/php85#release_managers # https://www.php.net/gpg-keys.php#gpg-8.5 @@ -211,14 +216,6 @@ ENV GPG_KEYS {{ "E609 13E4 DF20 9907 D8E3 0D96 659A 97C9 CF2A 795A", # sergey "1198 C011 7593 497A 5EC5 C199 286A F1F9 8974 69DC" # pierrick ], - - "8.1": [ - # https://wiki.php.net/todo/php81#release_managers - # https://www.php.net/gpg-keys.php#gpg-8.1 - "5289 95BF EDFB A719 1D46 839E F9BA 0ADA 31CB D89E", # krakjoe - "39B6 4134 3D8C 104B 2B14 6DC3 F9C3 9DC0 B969 8544", # ramsey - "F1F6 9223 8FBC 1666 E5A5 CCD4 199F 9DFE F6FF BAFD" # patrickallaert - ], }[rcVersion] // error("missing GPG keys for " + rcVersion) | map(gsub(" "; "")) | join(" ") @@ -288,14 +285,14 @@ RUN set -eux; \ "libsodium-dev", "libxml2-dev", "openssl-dev", - # https://github.com/docker-library/php/pull/1552 (11678) & https://github.com/docker-library/php/pull/1580 (14834) - if need_patch_11678 or need_patch_18743 then "patch", "patchutils" else empty end, + # https://github.com/docker-library/php/pull/1580 (18743) + if need_patch_18743 then "patch", "patchutils" else empty end, "readline-dev", "sqlite-dev", # https://github.com/docker-library/php/issues/888 "linux-headers", # oniguruma is part of mbstring in php 7.4+ - "oniguruma-dev" + if install_pear_pecl then "oniguruma-dev" else empty end else # debian packages if env.variant == "apache" then "apache2-dev" else empty end, @@ -308,7 +305,7 @@ RUN set -eux; \ "libxml2-dev", "zlib1g-dev", # oniguruma is part of mbstring in php 7.4+ - "libonig-dev" + if install_pear_pecl then "libonig-dev" else empty end end ] | sort[] | ( -}} {{ . }} \ @@ -333,32 +330,11 @@ RUN set -eux; \ ; \ docker-php-source extract; \ cd /usr/src/php; \ -{{ if need_patch_11678 then ( -}} -# Apply patches; see https://github.com/docker-library/php/pull/1552 - # https://github.com/php/php-src/issues/11678 - curl -fL 'https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc.patch?full_index=1' -o 11678.patch; \ - echo '6edc20c3bb3e7cc13515abce7f2fffa8ebea6cf7469abfbc78fcdc120350b239 *11678.patch' | sha256sum -c -; \ - patch -p1 < 11678.patch; \ - rm 11678.patch; \ - # https://github.com/php/php-src/issues/14834 - curl -fL 'https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609.patch?full_index=1' -o 14834.patch; \ - echo 'ed10a1b254091ad676ed204e55628ecbd6c8962004d6185a1821cedecd526c0f *14834.patch' | sha256sum -c -; \ - filterdiff -x '*/NEWS' 14834.patch | patch -p1; \ - rm 14834.patch; \ -{{ ) else "" end -}} -{{ - if need_patch_18743 then - # https://github.com/docker-library/php/pull/1580#issuecomment-2957191901 - { - "8.1": { url: "https://github.com/php/php-src/commit/6b105d4bc57e20a2472c9a6ff11fba32768556d4.patch?full_index=1", sha256: "037e1610ae5d444e9a8c3ecd9d5f0cd215fd0aac90bdd7b9f0b259bffdf3566b" }, - }[rcVersion] - // { url: "https://github.com/php/php-src/commit/b3c8afe272a6919248986c703c2e1defc73ff707.patch?full_index=1", sha256: "b334f73434c9732a4b27a42eb5d417e10df842e854c02a3e753b2479f8978bf5" } - | ( --}} +{{ if need_patch_18743 then ( -}} # https://github.com/php/php-src/issues/18743 "Incompatibility in Inline TLS Assembly on Alpine 3.22 with zend_jit_ir.c" # https://github.com/docker-library/php/pull/1580 - curl -fL {{ .url | @sh }} -o 18743.patch; \ - echo {{ "\(.sha256) *18743.patch" | @sh }} | sha256sum -c -; \ + curl -fL 'https://github.com/php/php-src/commit/b3c8afe272a6919248986c703c2e1defc73ff707.patch?full_index=1' -o 18743.patch; \ + echo 'b334f73434c9732a4b27a42eb5d417e10df842e854c02a3e753b2479f8978bf5 *18743.patch' | sha256sum -c -; \ filterdiff -x '*/NEWS' 18743.patch | patch -p1; \ rm 18743.patch; \ {{ ) else "" end -}} @@ -370,8 +346,21 @@ RUN set -eux; \ ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ fi; \ {{ ) end -}} + case "$gnuArch" in \ + 'i686-linux-'*) \ + # php zend jit assumes SSE registers, xmm0-7, are available (and "Pentium4"/SSE2 is a reasonable baseline) + # https://github.com/php/php-src/pull/22832 + # so, allow it and use SSE/SSE2 floating-point unit instead of the legacy stack + export \ + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" \ + CPPFLAGS="$CPPFLAGS -msse2 -mfpmath=sse" \ + ; \ + ;; \ + esac; \ + test "$PHP_INI_DIR" != "${PHP_INI_DIR%/php}"; \ ./configure \ --build="$gnuArch" \ + --sysconfdir="${PHP_INI_DIR%/php}" \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ @@ -381,15 +370,22 @@ RUN set -eux; \ # https://github.com/docker-library/php/issues/439 --with-mhash \ \ +{{ if IN(rcVersion; "8.2", "8.3", "8.4", "8.5") then ( -}} # https://github.com/docker-library/php/issues/822 --with-pic \ \ -{{ if rcVersion == "8.1" then ( -}} -# --enable-ftp is included here for compatibility with existing versions. ftp_ssl_connect() needed ftp to be compiled statically before PHP 7.0 (see https://github.com/docker-library/php/issues/236). - --enable-ftp \ -{{ ) else "" end -}} +{{ ) elif env.variant == "apache" then ( -}} +# https://github.com/docker-library/php/issues/822 +# https://github.com/php/php-src/pull/21067/changes#diff-4b9db5b77bcd56aa33b310dc44c8bc99c729c9abb195df2e98e6985b81289ae8R130 + --enable-pic \ + \ +{{ ) else ( -}} +# no --enable-pic; forcing PIC also removes -fpie from executable objects, preventing local-exec TLS: https://github.com/docker-library/php/pull/1692 +{{ ) end -}} +{{ if install_pear_pecl then ( -}} # --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) --enable-mbstring \ +{{ ) else "" end -}} # --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) --enable-mysqlnd \ # https://wiki.php.net/rfc/argon2_password_hash @@ -406,7 +402,7 @@ RUN set -eux; \ --with-readline \ --with-zlib \ \ -{{ if env.variant | IN("cli", "zts") then ( -}} +{{ if IN(env.variant; "cli", "nts", "zts") then ( -}} # https://github.com/docker-library/php/pull/1259 --enable-phpdbg \ --enable-phpdbg-readline \ @@ -415,10 +411,12 @@ RUN set -eux; \ --disable-phpdbg \ {{ ) end -}} \ +{{ if install_pear_pecl then ( -}} # in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") --with-pear \ \ -{{ if rcVersion | IN("8.1", "8.2") then ( -}} +{{ ) else "" end -}} +{{ if IN(rcVersion; "8.2") then ( -}} # bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+) # https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c # https://github.com/php/php-src/tree/php-8.3.0/ext/pcre/pcre2lib @@ -432,12 +430,12 @@ RUN set -eux; \ --with-libdir="lib/$debMultiarch" \ {{ ) end -}} {{ # https://github.com/docker-library/php/issues/280 -}} -{{ if env.variant | IN("cli", "zts") then "" else ( -}} +{{ if IN(env.variant; "cli", "nts", "zts") then "" else ( -}} \ --disable-cgi \ {{ ) end -}} {{ # zts + alpine special cased for embed (otherwise zts is effectively cli): https://github.com/docker-library/php/pull/1342 -}} -{{ if (env.variant == "zts") or (env.variant == "cli" and (is_alpine | not)) then ( -}} +{{ if env.variant == "zts" or (env.variant == "cli" and ((rcVersion | version_id) >= 80600 or (is_alpine | not))) then ( -}} \ # https://github.com/docker-library/php/pull/939#issuecomment-730501748 --enable-embed \ @@ -450,12 +448,13 @@ RUN set -eux; \ --enable-fpm \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ -{{ ) elif env.variant == "zts" then ( -}} +{{ ) else "" end -}} +{{ if env.variant == "zts" or ((rcVersion | version_id) >= 80600 and env.variant != "nts") then ( -}} \ --enable-zts \ # https://externals.io/message/118859 --disable-zend-signals \ -{{ if rcVersion | IN("8.1", "8.2") then ( -}} +{{ if IN(rcVersion; "8.2") then ( -}} --enable-zend-max-execution-timers \ {{ ) else "" end -}} {{ ) else "" end -}} @@ -514,16 +513,18 @@ RUN set -eux; \ {{ clean_apt }}; \ {{ ) end -}} \ +{{ if install_pear_pecl then ( -}} # update pecl channel definitions https://github.com/docker-library/php/issues/443 pecl update-channels; \ rm -rf /tmp/pear ~/.pearrc; \ \ +{{ ) else "" end -}} # smoke test php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ -{{ if IN(rcVersion; "8.1", "8.2", "8.3", "8.4") then ( -}} +{{ if IN(rcVersion; "8.2", "8.3", "8.4") then ( -}} # enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) RUN docker-php-ext-enable opcache @@ -544,20 +545,16 @@ EXPOSE 80 WORKDIR /var/www/html RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ + cd "${PHP_INI_DIR%/php}"; \ + \ + cp -v php-fpm.conf.default php-fpm.conf; \ + cp -v php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + \ + # comment out localhost-only listen address + grep -E '^listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + sed -ri 's/^(listen = 127.0.0.1:9000)/;\1/' php-fpm.d/www.conf; \ + grep -E '^;listen = 127.0.0.1:9000' php-fpm.d/www.conf; \ + \ { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ @@ -573,13 +570,18 @@ RUN set -eux; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ echo 'decorate_workers_output = no'; \ + echo; \ + echo '; default listen address for easy override in later php-fpm.d/*.conf files'; \ + echo 'listen = 9000'; \ } | tee php-fpm.d/docker.conf; \ { \ echo '[global]'; \ echo 'daemonize = no'; \ +{{ if IN(rcVersion; "8.2", "8.3", "8.4", "8.5") then ( -}} echo; \ + echo '; the [www] ini section below is for backwards compatibility and will be removed in 8.6+'; \ echo '[www]'; \ - echo 'listen = 9000'; \ +{{ ) else "" end -}} } | tee php-fpm.d/zz-docker.conf; \ mkdir -p "$PHP_INI_DIR/conf.d"; \ { \ diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index a887c8cbbe..eeeeb578ad 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -2,7 +2,7 @@ set -Eeuo pipefail declare -A aliases=( - [8.4]='8 latest' + [8.6]='8 latest' ) self="$(basename "$BASH_SOURCE")" @@ -117,13 +117,13 @@ for version; do ) ) | .[0] - # intl will not compile on Alpine 3.22 causing build failures for downstream images (joomla, mediawiki, wordpress): https://github.com/docker-library/php/issues/1585 - # since PHP 8.1 is EOL at the end of the year and wont likely get fixes, keep the default Alpine at 3.21 - | if env.version == "8.1" then - "alpine3.21" - else - . - end + ' versions.json)" + + # when there is an "nts" variant (and no "zts" variant), "cli" is the ZTS build + cliIsZts="$(jq -r ' + .[env.version].variants + | map(split("/")[1]) + | (index("nts") != null) and (index("zts") == null) ' versions.json)" for dir in "${variants[@]}"; do @@ -133,6 +133,9 @@ for version; do [ -f "$dir/Dockerfile" ] || continue variantAliases=( "${versionAliases[@]/%/-$variant}" ) + if [ "$variant" = 'cli' ] && [ "$cliIsZts" = 'true' ]; then + variantAliases+=( "${versionAliases[@]/%/-zts}" ) + fi variantAliases=( "${variantAliases[@]//latest-/}" ) if [ "$variant" = 'cli' ]; then @@ -151,6 +154,17 @@ for version; do variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$dir/Dockerfile")" variantArches="${parentRepoToArches[$variantParent]}" + # php segfaults on arm32v6 for these pre-releases + # https://github.com/docker-library/php/issues/1675 + if [[ "$suite" =~ 'alpine'* ]]; then + if [[ "$fullVersion" == '8.6.0beta'* ]]; then + variantArches="$(jq <<<"$variantArches" --raw-input --raw-output ' + split(" ") - [ "arm32v6" ] + | join(" ") + ')" + fi + fi + commit="$(dirCommit "$dir")" echo diff --git a/versions.json b/versions.json index c57c1fb212..509de57f65 100644 --- a/versions.json +++ b/versions.json @@ -1,9 +1,9 @@ { - "8.1": { - "version": "8.1.33", - "url": "https://www.php.net/distributions/php-8.1.33.tar.xz", - "ascUrl": "https://www.php.net/distributions/php-8.1.33.tar.xz.asc", - "sha256": "9db83bf4590375562bc1a10b353cccbcf9fcfc56c58b7c8fb814e6865bb928d1", + "8.2": { + "version": "8.2.36", + "url": "https://www.php.net/distributions/php-8.2.36.tar.xz", + "ascUrl": "https://www.php.net/distributions/php-8.2.36.tar.xz.asc", + "sha256": "df50a00d2b453096608bf2bd98a9fab9a3df8678a77b93011b65c3cfe9a018fa", "variants": [ "trixie/cli", "trixie/apache", @@ -13,20 +13,20 @@ "bookworm/apache", "bookworm/fpm", "bookworm/zts", - "alpine3.22/cli", - "alpine3.22/fpm", - "alpine3.22/zts", - "alpine3.21/cli", - "alpine3.21/fpm", - "alpine3.21/zts" + "alpine3.24/cli", + "alpine3.24/fpm", + "alpine3.24/zts", + "alpine3.23/cli", + "alpine3.23/fpm", + "alpine3.23/zts" ] }, - "8.1-rc": null, - "8.2": { - "version": "8.2.29", - "url": "https://www.php.net/distributions/php-8.2.29.tar.xz", - "ascUrl": "https://www.php.net/distributions/php-8.2.29.tar.xz.asc", - "sha256": "475f991afd2d5b901fb410be407d929bc00c46285d3f439a02c59e8b6fe3589c", + "8.2-rc": null, + "8.3": { + "version": "8.3.37", + "url": "https://www.php.net/distributions/php-8.3.37.tar.xz", + "ascUrl": "https://www.php.net/distributions/php-8.3.37.tar.xz.asc", + "sha256": "0237af84478b7a7649d3964153f1b8653d622550b846f56d63062de683fb86bb", "variants": [ "trixie/cli", "trixie/apache", @@ -36,20 +36,20 @@ "bookworm/apache", "bookworm/fpm", "bookworm/zts", - "alpine3.22/cli", - "alpine3.22/fpm", - "alpine3.22/zts", - "alpine3.21/cli", - "alpine3.21/fpm", - "alpine3.21/zts" + "alpine3.24/cli", + "alpine3.24/fpm", + "alpine3.24/zts", + "alpine3.23/cli", + "alpine3.23/fpm", + "alpine3.23/zts" ] }, - "8.2-rc": null, - "8.3": { - "version": "8.3.24", - "url": "https://www.php.net/distributions/php-8.3.24.tar.xz", - "ascUrl": "https://www.php.net/distributions/php-8.3.24.tar.xz.asc", - "sha256": "388ee5fd111097e97bae439bff46aec4ea27f816d3f0c2cb5490a41410d44251", + "8.3-rc": null, + "8.4": { + "version": "8.4.28", + "url": "https://www.php.net/distributions/php-8.4.28.tar.xz", + "ascUrl": "https://www.php.net/distributions/php-8.4.28.tar.xz.asc", + "sha256": "0c8ec360e5dd8154f270b2fd50cd44ecc824e6ee39c85f911312b80d4daecd72", "variants": [ "trixie/cli", "trixie/apache", @@ -59,20 +59,20 @@ "bookworm/apache", "bookworm/fpm", "bookworm/zts", - "alpine3.22/cli", - "alpine3.22/fpm", - "alpine3.22/zts", - "alpine3.21/cli", - "alpine3.21/fpm", - "alpine3.21/zts" + "alpine3.24/cli", + "alpine3.24/fpm", + "alpine3.24/zts", + "alpine3.23/cli", + "alpine3.23/fpm", + "alpine3.23/zts" ] }, - "8.3-rc": null, - "8.4": { - "version": "8.4.11", - "url": "https://www.php.net/distributions/php-8.4.11.tar.xz", - "ascUrl": "https://www.php.net/distributions/php-8.4.11.tar.xz.asc", - "sha256": "04cd331380a8683a5c2503938eb51764d48d507c53ad4208d2c82e0eed779a00", + "8.4-rc": null, + "8.5": { + "version": "8.5.13", + "url": "https://www.php.net/distributions/php-8.5.13.tar.xz", + "ascUrl": "https://www.php.net/distributions/php-8.5.13.tar.xz.asc", + "sha256": "607602acaf0c3061818e9916ec44a058e8b3d43959a83862b9cd3ec7bf5b785f", "variants": [ "trixie/cli", "trixie/apache", @@ -82,35 +82,36 @@ "bookworm/apache", "bookworm/fpm", "bookworm/zts", - "alpine3.22/cli", - "alpine3.22/fpm", - "alpine3.22/zts", - "alpine3.21/cli", - "alpine3.21/fpm", - "alpine3.21/zts" + "alpine3.24/cli", + "alpine3.24/fpm", + "alpine3.24/zts", + "alpine3.23/cli", + "alpine3.23/fpm", + "alpine3.23/zts" ] }, - "8.4-rc": null, - "8.5-rc": { - "version": "8.5.0alpha4", - "url": "https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz", - "ascUrl": "https://downloads.php.net/~daniels/php-8.5.0alpha4.tar.xz.asc", - "sha256": "5d33e15942d89956814f1521540210c58174c7f72dd277deda6b99709173e2db", + "8.5-rc": null, + "8.6": { + "version": "8.6.0", + "url": "https://www.php.net/distributions/php-8.6.0.tar.xz", + "ascUrl": "https://www.php.net/distributions/php-8.6.0.tar.xz.asc", + "sha256": "5f84beaa3d763aee1e4feed99bf54ec692c383b322e25626807b589238c3a087", "variants": [ "trixie/cli", "trixie/apache", "trixie/fpm", - "trixie/zts", + "trixie/nts", "bookworm/cli", "bookworm/apache", "bookworm/fpm", - "bookworm/zts", - "alpine3.22/cli", - "alpine3.22/fpm", - "alpine3.22/zts", - "alpine3.21/cli", - "alpine3.21/fpm", - "alpine3.21/zts" + "bookworm/nts", + "alpine3.24/cli", + "alpine3.24/fpm", + "alpine3.24/nts", + "alpine3.23/cli", + "alpine3.23/fpm", + "alpine3.23/nts" ] - } + }, + "8.6-rc": null } diff --git a/versions.sh b/versions.sh index 02a790629a..91dbcb006e 100755 --- a/versions.sh +++ b/versions.sh @@ -3,7 +3,7 @@ set -Eeuo pipefail cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" -# TODO consume https://www.php.net/releases/branches.php and https://www.php.net/release-candidates.php?format=json here like in Go, Julia, etc (so we can have a canonical "here's all the versions possible" mode, and more automated metadata like EOL 👀) +# TODO consume https://www.php.net/releases/branches.php and https://www.php.net/pre-release-builds.php?format=json here like in Go, Julia, etc (so we can have a canonical "here's all the versions possible" mode, and more automated metadata like EOL 👀) versions=( "$@" ) if [ ${#versions[@]} -eq 0 ]; then @@ -14,6 +14,8 @@ else fi versions=( "${versions[@]%/}" ) +now="$(date --utc '+%s')" + for version in "${versions[@]}"; do rcVersion="${version%-rc}" export version rcVersion @@ -33,7 +35,7 @@ for version in "${versions[@]}"; do ) ] ' else - apiUrl='https://www.php.net/release-candidates.php?format=json' + apiUrl='https://www.php.net/pre-release-builds.php?format=json' apiJqExpr=' (.releases // [])[] | select(.version | startswith(env.rcVersion)) @@ -45,6 +47,7 @@ for version in "${versions[@]}"; do ] ' fi + apiUrl+="&cachebuster=$now" # combat over-aggressive cache on php.net IFS=$'\n' possibles=( $( curl -fsSL "$apiUrl" \ @@ -77,36 +80,37 @@ for version in "${versions[@]}"; do ascUrl="$url.asc" fi - variants='[]' - # order here controls the order of the library/ file - for suite in \ - trixie \ - bookworm \ - alpine3.22 \ - alpine3.21 \ - ; do - for variant in cli apache fpm zts; do - if [[ "$suite" = alpine* ]]; then - if [ "$variant" = 'apache' ]; then - continue - fi - fi - export suite variant - variants="$(jq <<<"$variants" -c '. + [ env.suite + "/" + env.variant ]')" - done - done - echo "$version: $fullVersion" export fullVersion url ascUrl sha256 json="$( - jq <<<"$json" -c --argjson variants "$variants" ' + jq <<<"$json" -c ' .[env.version] = { version: env.fullVersion, url: env.url, ascUrl: env.ascUrl, sha256: env.sha256, - variants: $variants, + variants: [ + # order here controls the order of the library/ file + ( + "trixie", + "bookworm", + "alpine3.24", + "alpine3.23", + empty + ) as $suite + | ( + "cli", + "apache", + "fpm", + (if IN(env.rcVersion; "8.2", "8.3", "8.4", "8.5") then "zts" else empty end), + (if IN(env.rcVersion; "8.6") then "nts" else empty end), + empty + ) as $variant + | if $suite | startswith("alpine") and $variant == "apache" then empty else + "\($suite)/\($variant)" + end + ], } ' )"