|
@@ -1,120 +1,4 @@
|
|
|
-FROM php:8.2.0RC5-zts-alpine3.16 AS php-base
|
|
|
-
|
|
|
-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 \
|
|
|
- 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" \
|
|
|
- ; \
|
|
|
- docker-php-source extract; \
|
|
|
- cd /usr/src/php; \
|
|
|
- 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 because ftp_ssl_connect() needs ftp to be compiled statically (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 s390x
|
|
|
-# https://manpages.debian.org/bullseye/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT
|
|
|
- $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \
|
|
|
- \
|
|
|
- --disable-cgi \
|
|
|
- \
|
|
|
- --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; \
|
|
|
- \
|
|
|
-# update pecl channel definitions https://github.com/docker-library/php/issues/443
|
|
|
- pecl update-channels; \
|
|
|
- rm -rf /tmp/pear ~/.pearrc; \
|
|
|
- \
|
|
|
-# smoke test
|
|
|
- php --version
|
|
|
-
|
|
|
-FROM php-base AS builder
|
|
|
+FROM php:8.2.0RC6-zts-alpine3.16 AS builder
|
|
|
|
|
|
COPY --from=golang:alpine3.16 /usr/local/go/bin/go /usr/local/bin/go
|
|
|
COPY --from=golang:alpine3.16 /usr/local/go /usr/local/go
|
|
@@ -160,7 +44,7 @@ RUN cd caddy/frankenphp && \
|
|
|
|
|
|
ENTRYPOINT ["/bin/sh","-c"]
|
|
|
|
|
|
-FROM php-base AS final
|
|
|
+FROM php:8.2.0RC6-zts-alpine3.16 AS final
|
|
|
|
|
|
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
|
|
|