From 82d590a8c776568c9548fd5ca8afaa1abb72dbac Mon Sep 17 00:00:00 2001 From: J0WI Date: Mon, 17 Jun 2019 21:21:55 +0200 Subject: [PATCH 1/2] Use already available curl and consistent code style --- 7.1/alpine3.10/cli/Dockerfile | 58 ++++++++++++------------- 7.1/alpine3.10/fpm/Dockerfile | 72 ++++++++++++++++---------------- 7.1/alpine3.10/zts/Dockerfile | 58 ++++++++++++------------- 7.1/alpine3.9/cli/Dockerfile | 58 ++++++++++++------------- 7.1/alpine3.9/fpm/Dockerfile | 72 ++++++++++++++++---------------- 7.1/alpine3.9/zts/Dockerfile | 58 ++++++++++++------------- 7.1/stretch/apache/Dockerfile | 23 +++++----- 7.1/stretch/cli/Dockerfile | 23 +++++----- 7.1/stretch/fpm/Dockerfile | 37 ++++++++-------- 7.1/stretch/zts/Dockerfile | 23 +++++----- 7.2/alpine3.10/cli/Dockerfile | 58 ++++++++++++------------- 7.2/alpine3.10/fpm/Dockerfile | 72 ++++++++++++++++---------------- 7.2/alpine3.10/zts/Dockerfile | 58 ++++++++++++------------- 7.2/alpine3.9/cli/Dockerfile | 58 ++++++++++++------------- 7.2/alpine3.9/fpm/Dockerfile | 72 ++++++++++++++++---------------- 7.2/alpine3.9/zts/Dockerfile | 58 ++++++++++++------------- 7.2/stretch/apache/Dockerfile | 23 +++++----- 7.2/stretch/cli/Dockerfile | 23 +++++----- 7.2/stretch/fpm/Dockerfile | 37 ++++++++-------- 7.2/stretch/zts/Dockerfile | 23 +++++----- 7.3/alpine3.10/cli/Dockerfile | 58 ++++++++++++------------- 7.3/alpine3.10/fpm/Dockerfile | 72 ++++++++++++++++---------------- 7.3/alpine3.10/zts/Dockerfile | 58 ++++++++++++------------- 7.3/alpine3.9/cli/Dockerfile | 58 ++++++++++++------------- 7.3/alpine3.9/fpm/Dockerfile | 72 ++++++++++++++++---------------- 7.3/alpine3.9/zts/Dockerfile | 58 ++++++++++++------------- 7.3/stretch/apache/Dockerfile | 23 +++++----- 7.3/stretch/cli/Dockerfile | 23 +++++----- 7.3/stretch/fpm/Dockerfile | 37 ++++++++-------- 7.3/stretch/zts/Dockerfile | 23 +++++----- 7.4-rc/alpine3.10/cli/Dockerfile | 54 ++++++++++++------------ 7.4-rc/alpine3.10/fpm/Dockerfile | 68 +++++++++++++++--------------- 7.4-rc/alpine3.10/zts/Dockerfile | 54 ++++++++++++------------ 7.4-rc/alpine3.9/cli/Dockerfile | 54 ++++++++++++------------ 7.4-rc/alpine3.9/fpm/Dockerfile | 68 +++++++++++++++--------------- 7.4-rc/alpine3.9/zts/Dockerfile | 54 ++++++++++++------------ 7.4-rc/stretch/apache/Dockerfile | 23 +++++----- 7.4-rc/stretch/cli/Dockerfile | 23 +++++----- 7.4-rc/stretch/fpm/Dockerfile | 37 ++++++++-------- 7.4-rc/stretch/zts/Dockerfile | 23 +++++----- Dockerfile-alpine.template | 58 ++++++++++++------------- Dockerfile-debian.template | 23 +++++----- fpm-Dockerfile-block-2 | 14 +++---- 43 files changed, 1033 insertions(+), 966 deletions(-) diff --git a/7.1/alpine3.10/cli/Dockerfile b/7.1/alpine3.10/cli/Dockerfile index 159519aba..2254b3df2 100644 --- a/7.1/alpine3.10/cli/Dockerfile +++ b/7.1/alpine3.10/cli/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -69,13 +69,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -85,7 +84,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -99,8 +98,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ coreutils \ curl-dev \ @@ -108,14 +107,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -143,33 +144,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.1/alpine3.10/fpm/Dockerfile b/7.1/alpine3.10/fpm/Dockerfile index fc9b50085..90e6b5868 100644 --- a/7.1/alpine3.10/fpm/Dockerfile +++ b/7.1/alpine3.10/fpm/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ coreutils \ curl-dev \ @@ -109,14 +108,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -144,33 +145,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ @@ -178,9 +180,9 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -192,8 +194,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + fi; \ + { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ echo; \ @@ -205,8 +207,8 @@ RUN set -ex \ echo; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ - } | tee php-fpm.d/docker.conf \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ diff --git a/7.1/alpine3.10/zts/Dockerfile b/7.1/alpine3.10/zts/Dockerfile index 41608f662..59e5b31f1 100644 --- a/7.1/alpine3.10/zts/Dockerfile +++ b/7.1/alpine3.10/zts/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ coreutils \ curl-dev \ @@ -109,14 +108,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -144,33 +145,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.1/alpine3.9/cli/Dockerfile b/7.1/alpine3.9/cli/Dockerfile index 7ac2d91f9..44b9717b4 100644 --- a/7.1/alpine3.9/cli/Dockerfile +++ b/7.1/alpine3.9/cli/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -69,13 +69,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -85,7 +84,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -99,8 +98,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ coreutils \ curl-dev \ @@ -108,14 +107,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -143,33 +144,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.1/alpine3.9/fpm/Dockerfile b/7.1/alpine3.9/fpm/Dockerfile index bb646a346..12df001f8 100644 --- a/7.1/alpine3.9/fpm/Dockerfile +++ b/7.1/alpine3.9/fpm/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ coreutils \ curl-dev \ @@ -109,14 +108,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -144,33 +145,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ @@ -178,9 +180,9 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -192,8 +194,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + fi; \ + { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ echo; \ @@ -205,8 +207,8 @@ RUN set -ex \ echo; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ - } | tee php-fpm.d/docker.conf \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ diff --git a/7.1/alpine3.9/zts/Dockerfile b/7.1/alpine3.9/zts/Dockerfile index 5dc45d76f..07a14db4b 100644 --- a/7.1/alpine3.9/zts/Dockerfile +++ b/7.1/alpine3.9/zts/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ coreutils \ curl-dev \ @@ -109,14 +108,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -144,33 +145,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.1/stretch/apache/Dockerfile b/7.1/stretch/apache/Dockerfile index 323dce497..0223674dc 100644 --- a/7.1/stretch/apache/Dockerfile +++ b/7.1/stretch/apache/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -126,23 +129,21 @@ ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -152,7 +153,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/7.1/stretch/cli/Dockerfile b/7.1/stretch/cli/Dockerfile index c178dfacc..7621790db 100644 --- a/7.1/stretch/cli/Dockerfile +++ b/7.1/stretch/cli/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -66,23 +69,21 @@ ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -92,7 +93,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/7.1/stretch/fpm/Dockerfile b/7.1/stretch/fpm/Dockerfile index 8e4ac4930..967195906 100644 --- a/7.1/stretch/fpm/Dockerfile +++ b/7.1/stretch/fpm/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -67,23 +70,21 @@ ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -93,7 +94,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -202,9 +203,9 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -216,8 +217,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + fi; \ + { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ echo; \ @@ -229,8 +230,8 @@ RUN set -ex \ echo; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ - } | tee php-fpm.d/docker.conf \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ diff --git a/7.1/stretch/zts/Dockerfile b/7.1/stretch/zts/Dockerfile index 9d2e696a1..23da5daa1 100644 --- a/7.1/stretch/zts/Dockerfile +++ b/7.1/stretch/zts/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -67,23 +70,21 @@ ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -93,7 +94,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/7.2/alpine3.10/cli/Dockerfile b/7.2/alpine3.10/cli/Dockerfile index fe938596b..865b11041 100644 --- a/7.2/alpine3.10/cli/Dockerfile +++ b/7.2/alpine3.10/cli/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -69,13 +69,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -85,7 +84,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -99,8 +98,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -110,14 +109,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -149,33 +150,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.2/alpine3.10/fpm/Dockerfile b/7.2/alpine3.10/fpm/Dockerfile index a6942bcd8..8579603bc 100644 --- a/7.2/alpine3.10/fpm/Dockerfile +++ b/7.2/alpine3.10/fpm/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -111,14 +110,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -150,33 +151,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ @@ -187,9 +189,9 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -201,8 +203,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + fi; \ + { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ echo; \ @@ -214,8 +216,8 @@ RUN set -ex \ echo; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ - } | tee php-fpm.d/docker.conf \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ diff --git a/7.2/alpine3.10/zts/Dockerfile b/7.2/alpine3.10/zts/Dockerfile index 63bc0bc59..c69667a1c 100644 --- a/7.2/alpine3.10/zts/Dockerfile +++ b/7.2/alpine3.10/zts/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -111,14 +110,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -150,33 +151,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.2/alpine3.9/cli/Dockerfile b/7.2/alpine3.9/cli/Dockerfile index c8f7e39cc..0a0f6d230 100644 --- a/7.2/alpine3.9/cli/Dockerfile +++ b/7.2/alpine3.9/cli/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -69,13 +69,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -85,7 +84,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -99,8 +98,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -110,14 +109,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -149,33 +150,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.2/alpine3.9/fpm/Dockerfile b/7.2/alpine3.9/fpm/Dockerfile index 21eb4dc12..593ece094 100644 --- a/7.2/alpine3.9/fpm/Dockerfile +++ b/7.2/alpine3.9/fpm/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -111,14 +110,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -150,33 +151,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ @@ -187,9 +189,9 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -201,8 +203,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + fi; \ + { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ echo; \ @@ -214,8 +216,8 @@ RUN set -ex \ echo; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ - } | tee php-fpm.d/docker.conf \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ diff --git a/7.2/alpine3.9/zts/Dockerfile b/7.2/alpine3.9/zts/Dockerfile index 603297d09..b07b45458 100644 --- a/7.2/alpine3.9/zts/Dockerfile +++ b/7.2/alpine3.9/zts/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -111,14 +110,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -150,33 +151,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.2/stretch/apache/Dockerfile b/7.2/stretch/apache/Dockerfile index 46146eb0c..2785eb549 100644 --- a/7.2/stretch/apache/Dockerfile +++ b/7.2/stretch/apache/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -126,23 +129,21 @@ ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282 RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -152,7 +153,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/7.2/stretch/cli/Dockerfile b/7.2/stretch/cli/Dockerfile index 3a5669cca..6c20b7b90 100644 --- a/7.2/stretch/cli/Dockerfile +++ b/7.2/stretch/cli/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -66,23 +69,21 @@ ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282 RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -92,7 +93,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/7.2/stretch/fpm/Dockerfile b/7.2/stretch/fpm/Dockerfile index f2c4ef8ee..8696f8db5 100644 --- a/7.2/stretch/fpm/Dockerfile +++ b/7.2/stretch/fpm/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -67,23 +70,21 @@ ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282 RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -93,7 +94,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -224,9 +225,9 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -238,8 +239,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + fi; \ + { \ echo '[global]'; \ echo 'error_log = /proc/self/fd/2'; \ echo; \ @@ -251,8 +252,8 @@ RUN set -ex \ echo; \ echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ echo 'catch_workers_output = yes'; \ - } | tee php-fpm.d/docker.conf \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ diff --git a/7.2/stretch/zts/Dockerfile b/7.2/stretch/zts/Dockerfile index 2eabca833..677c0a276 100644 --- a/7.2/stretch/zts/Dockerfile +++ b/7.2/stretch/zts/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -67,23 +70,21 @@ ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282 RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -93,7 +94,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/7.3/alpine3.10/cli/Dockerfile b/7.3/alpine3.10/cli/Dockerfile index e3aa8f0f9..2dcc0c60e 100644 --- a/7.3/alpine3.10/cli/Dockerfile +++ b/7.3/alpine3.10/cli/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -69,13 +69,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -85,7 +84,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -99,8 +98,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -110,14 +109,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -149,33 +150,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.3/alpine3.10/fpm/Dockerfile b/7.3/alpine3.10/fpm/Dockerfile index e2d690c6e..4714d5a6e 100644 --- a/7.3/alpine3.10/fpm/Dockerfile +++ b/7.3/alpine3.10/fpm/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -111,14 +110,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -150,33 +151,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ @@ -187,9 +189,9 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -201,8 +203,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + 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'; \ @@ -216,8 +218,8 @@ RUN set -ex \ 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 \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ diff --git a/7.3/alpine3.10/zts/Dockerfile b/7.3/alpine3.10/zts/Dockerfile index 3f2b527f4..77d62bb4e 100644 --- a/7.3/alpine3.10/zts/Dockerfile +++ b/7.3/alpine3.10/zts/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -111,14 +110,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -150,33 +151,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.3/alpine3.9/cli/Dockerfile b/7.3/alpine3.9/cli/Dockerfile index 7f4e32b8c..be9d318ce 100644 --- a/7.3/alpine3.9/cli/Dockerfile +++ b/7.3/alpine3.9/cli/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -69,13 +69,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -85,7 +84,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -99,8 +98,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -110,14 +109,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -149,33 +150,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.3/alpine3.9/fpm/Dockerfile b/7.3/alpine3.9/fpm/Dockerfile index 4be41c86b..231d3facf 100644 --- a/7.3/alpine3.9/fpm/Dockerfile +++ b/7.3/alpine3.9/fpm/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -111,14 +110,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -150,33 +151,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ @@ -187,9 +189,9 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -201,8 +203,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + 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'; \ @@ -216,8 +218,8 @@ RUN set -ex \ 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 \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ diff --git a/7.3/alpine3.9/zts/Dockerfile b/7.3/alpine3.9/zts/Dockerfile index 615cb4cf1..68cf21b7a 100644 --- a/7.3/alpine3.9/zts/Dockerfile +++ b/7.3/alpine3.9/zts/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -111,14 +110,16 @@ RUN set -xe \ libxml2-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + 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 \ + ; \ + 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" \ @@ -150,33 +151,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.3/stretch/apache/Dockerfile b/7.3/stretch/apache/Dockerfile index eab40b98d..1039b60f3 100644 --- a/7.3/stretch/apache/Dockerfile +++ b/7.3/stretch/apache/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -126,23 +129,21 @@ ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164 RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -152,7 +153,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/7.3/stretch/cli/Dockerfile b/7.3/stretch/cli/Dockerfile index 7674156b6..f7c01fb8c 100644 --- a/7.3/stretch/cli/Dockerfile +++ b/7.3/stretch/cli/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -66,23 +69,21 @@ ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164 RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -92,7 +93,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/7.3/stretch/fpm/Dockerfile b/7.3/stretch/fpm/Dockerfile index bc36c2aee..39d1578d1 100644 --- a/7.3/stretch/fpm/Dockerfile +++ b/7.3/stretch/fpm/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -67,23 +70,21 @@ ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164 RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -93,7 +94,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -224,9 +225,9 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -238,8 +239,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + 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'; \ @@ -253,8 +254,8 @@ RUN set -ex \ 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 \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ diff --git a/7.3/stretch/zts/Dockerfile b/7.3/stretch/zts/Dockerfile index 561a57565..25efaf217 100644 --- a/7.3/stretch/zts/Dockerfile +++ b/7.3/stretch/zts/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -67,23 +70,21 @@ ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164 RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -93,7 +94,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/7.4-rc/alpine3.10/cli/Dockerfile b/7.4-rc/alpine3.10/cli/Dockerfile index 6f464ff3d..dc063101e 100644 --- a/7.4-rc/alpine3.10/cli/Dockerfile +++ b/7.4-rc/alpine3.10/cli/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -69,13 +69,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -85,7 +84,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -99,8 +98,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -111,17 +110,19 @@ RUN set -xe \ oniguruma-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + export CFLAGS="$PHP_CFLAGS" \ CPPFLAGS="$PHP_CPPFLAGS" \ LDFLAGS="$PHP_LDFLAGS" \ # fix ARGON2 detection for 7.4-alpha1 https://github.com/docker-library/php/pull/840#pullrequestreview-249660894 ARGON2_LIBS="-largon2" \ ARGON2_CFLAGS="-I/usr/include" \ - && docker-php-source extract \ - && cd /usr/src/php \ - && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ - && ./configure \ + ; \ + 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" \ @@ -153,30 +154,31 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + apk del --no-network .build-deps; \ \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.4-rc/alpine3.10/fpm/Dockerfile b/7.4-rc/alpine3.10/fpm/Dockerfile index 7cfd69d40..6d9728b12 100644 --- a/7.4-rc/alpine3.10/fpm/Dockerfile +++ b/7.4-rc/alpine3.10/fpm/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -112,17 +111,19 @@ RUN set -xe \ oniguruma-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + export CFLAGS="$PHP_CFLAGS" \ CPPFLAGS="$PHP_CPPFLAGS" \ LDFLAGS="$PHP_LDFLAGS" \ # fix ARGON2 detection for 7.4-alpha1 https://github.com/docker-library/php/pull/840#pullrequestreview-249660894 ARGON2_LIBS="-largon2" \ ARGON2_CFLAGS="-I/usr/include" \ - && docker-php-source extract \ - && cd /usr/src/php \ - && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ - && ./configure \ + ; \ + 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" \ @@ -154,30 +155,31 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + apk del --no-network .build-deps; \ \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ @@ -188,9 +190,9 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -202,8 +204,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + 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'; \ @@ -217,8 +219,8 @@ RUN set -ex \ 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 \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ diff --git a/7.4-rc/alpine3.10/zts/Dockerfile b/7.4-rc/alpine3.10/zts/Dockerfile index 238f4d567..4b0bf0d5e 100644 --- a/7.4-rc/alpine3.10/zts/Dockerfile +++ b/7.4-rc/alpine3.10/zts/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -112,17 +111,19 @@ RUN set -xe \ oniguruma-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + export CFLAGS="$PHP_CFLAGS" \ CPPFLAGS="$PHP_CPPFLAGS" \ LDFLAGS="$PHP_LDFLAGS" \ # fix ARGON2 detection for 7.4-alpha1 https://github.com/docker-library/php/pull/840#pullrequestreview-249660894 ARGON2_LIBS="-largon2" \ ARGON2_CFLAGS="-I/usr/include" \ - && docker-php-source extract \ - && cd /usr/src/php \ - && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ - && ./configure \ + ; \ + 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" \ @@ -154,30 +155,31 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + apk del --no-network .build-deps; \ \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.4-rc/alpine3.9/cli/Dockerfile b/7.4-rc/alpine3.9/cli/Dockerfile index 3a5075eb3..8954d8a6e 100644 --- a/7.4-rc/alpine3.9/cli/Dockerfile +++ b/7.4-rc/alpine3.9/cli/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -69,13 +69,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -85,7 +84,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -99,8 +98,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -111,17 +110,19 @@ RUN set -xe \ oniguruma-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + export CFLAGS="$PHP_CFLAGS" \ CPPFLAGS="$PHP_CPPFLAGS" \ LDFLAGS="$PHP_LDFLAGS" \ # fix ARGON2 detection for 7.4-alpha1 https://github.com/docker-library/php/pull/840#pullrequestreview-249660894 ARGON2_LIBS="-largon2" \ ARGON2_CFLAGS="-I/usr/include" \ - && docker-php-source extract \ - && cd /usr/src/php \ - && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ - && ./configure \ + ; \ + 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" \ @@ -153,30 +154,31 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + apk del --no-network .build-deps; \ \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.4-rc/alpine3.9/fpm/Dockerfile b/7.4-rc/alpine3.9/fpm/Dockerfile index 27037a3c5..4a755b67f 100644 --- a/7.4-rc/alpine3.9/fpm/Dockerfile +++ b/7.4-rc/alpine3.9/fpm/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -112,17 +111,19 @@ RUN set -xe \ oniguruma-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + export CFLAGS="$PHP_CFLAGS" \ CPPFLAGS="$PHP_CPPFLAGS" \ LDFLAGS="$PHP_LDFLAGS" \ # fix ARGON2 detection for 7.4-alpha1 https://github.com/docker-library/php/pull/840#pullrequestreview-249660894 ARGON2_LIBS="-largon2" \ ARGON2_CFLAGS="-I/usr/include" \ - && docker-php-source extract \ - && cd /usr/src/php \ - && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ - && ./configure \ + ; \ + 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" \ @@ -154,30 +155,31 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + apk del --no-network .build-deps; \ \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ @@ -188,9 +190,9 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -202,8 +204,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + 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'; \ @@ -217,8 +219,8 @@ RUN set -ex \ 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 \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ diff --git a/7.4-rc/alpine3.9/zts/Dockerfile b/7.4-rc/alpine3.9/zts/Dockerfile index 51d980455..a7611c05a 100644 --- a/7.4-rc/alpine3.9/zts/Dockerfile +++ b/7.4-rc/alpine3.9/zts/Dockerfile @@ -29,9 +29,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -70,13 +70,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +85,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -100,8 +99,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -112,17 +111,19 @@ RUN set -xe \ oniguruma-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + export CFLAGS="$PHP_CFLAGS" \ CPPFLAGS="$PHP_CPPFLAGS" \ LDFLAGS="$PHP_LDFLAGS" \ # fix ARGON2 detection for 7.4-alpha1 https://github.com/docker-library/php/pull/840#pullrequestreview-249660894 ARGON2_LIBS="-largon2" \ ARGON2_CFLAGS="-I/usr/include" \ - && docker-php-source extract \ - && cd /usr/src/php \ - && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ - && ./configure \ + ; \ + 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" \ @@ -154,30 +155,31 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + apk del --no-network .build-deps; \ \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/7.4-rc/stretch/apache/Dockerfile b/7.4-rc/stretch/apache/Dockerfile index 4321c8623..067189ccf 100644 --- a/7.4-rc/stretch/apache/Dockerfile +++ b/7.4-rc/stretch/apache/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -126,23 +129,21 @@ ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364 RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -152,7 +153,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/7.4-rc/stretch/cli/Dockerfile b/7.4-rc/stretch/cli/Dockerfile index fde149cf0..27e3eddd1 100644 --- a/7.4-rc/stretch/cli/Dockerfile +++ b/7.4-rc/stretch/cli/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -66,23 +69,21 @@ ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364 RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -92,7 +93,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/7.4-rc/stretch/fpm/Dockerfile b/7.4-rc/stretch/fpm/Dockerfile index 616399084..7411cb549 100644 --- a/7.4-rc/stretch/fpm/Dockerfile +++ b/7.4-rc/stretch/fpm/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -67,23 +70,21 @@ ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364 RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -93,7 +94,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -222,9 +223,9 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -236,8 +237,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + 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'; \ @@ -251,8 +252,8 @@ RUN set -ex \ 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 \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ diff --git a/7.4-rc/stretch/zts/Dockerfile b/7.4-rc/stretch/zts/Dockerfile index 37a3d9461..695f18cfa 100644 --- a/7.4-rc/stretch/zts/Dockerfile +++ b/7.4-rc/stretch/zts/Dockerfile @@ -29,12 +29,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -67,23 +70,21 @@ ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364 RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -93,7 +94,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 2f4b9caf5..69c6fcca4 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -23,9 +23,9 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -x \ - && addgroup -g 82 -S www-data \ - && adduser -u 82 -D -S -G www-data www-data +RUN set -xe; \ + addgroup -g 82 -S www-data; \ + 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.9-stable # https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable @@ -63,13 +63,12 @@ RUN set -xe; \ \ apk add --no-cache --virtual .fetch-deps \ gnupg \ - wget \ ; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -79,7 +78,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ @@ -93,8 +92,8 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe \ - && apk add --no-cache --virtual .build-deps \ +RUN set -xe; \ + apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ coreutils \ @@ -105,17 +104,19 @@ RUN set -xe \ oniguruma-dev \ openssl-dev \ sqlite-dev \ + ; \ \ - && export CFLAGS="$PHP_CFLAGS" \ + export CFLAGS="$PHP_CFLAGS" \ CPPFLAGS="$PHP_CPPFLAGS" \ LDFLAGS="$PHP_LDFLAGS" \ # fix ARGON2 detection for 7.4-alpha1 https://github.com/docker-library/php/pull/840#pullrequestreview-249660894 ARGON2_LIBS="-largon2" \ ARGON2_CFLAGS="-I/usr/include" \ - && docker-php-source extract \ - && cd /usr/src/php \ - && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ - && ./configure \ + ; \ + 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" \ @@ -147,33 +148,34 @@ RUN set -xe \ $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j "$(nproc)" \ - && find -type f -name '*.a' -delete \ - && make install \ - && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ - && make clean \ + ; \ + make -j "$(nproc)"; \ + find -type f -name '*.a' -delete; \ + make install; \ + { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + 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/" \ + cp -v php.ini-* "$PHP_INI_DIR/"; \ \ - && cd / \ - && docker-php-source delete \ + cd /; \ + docker-php-source delete; \ \ - && runDeps="$( \ + 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 add --no-cache $runDeps; \ \ - && apk del --no-network .build-deps \ + 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 \ + pecl update-channels; \ + rm -rf /tmp/pear ~/.pearrc; \ # smoke test - && php --version + php --version COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index f663b60ed..7cbc8e43a 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -23,12 +23,15 @@ ENV PHPIZE_DEPS \ re2c # persistent / runtime deps -RUN apt-get update && apt-get install -y \ +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ $PHPIZE_DEPS \ ca-certificates \ curl \ xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* + ; \ + rm -rf /var/lib/apt/lists/* ENV PHP_INI_DIR /usr/local/etc/php RUN set -eux; \ @@ -60,23 +63,21 @@ ENV PHP_SHA256="%%PHP_SHA256%%" PHP_MD5="%%PHP_MD5%%" RUN set -xe; \ \ - fetchDeps=' \ - wget \ - '; \ if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ + fetchDeps=" \ dirmngr \ gnupg \ "; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends $fetchDeps; \ + rm -rf /var/lib/apt/lists/*; \ fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ \ - wget -O php.tar.xz "$PHP_URL"; \ + curl -fsSL -o php.tar.xz "$PHP_URL"; \ \ if [ -n "$PHP_SHA256" ]; then \ echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ @@ -86,7 +87,7 @@ RUN set -xe; \ fi; \ \ if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; \ export GNUPGHOME="$(mktemp -d)"; \ for key in $GPG_KEYS; do \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ diff --git a/fpm-Dockerfile-block-2 b/fpm-Dockerfile-block-2 index 50f96e50a..8e698a1b0 100644 --- a/fpm-Dockerfile-block-2 +++ b/fpm-Dockerfile-block-2 @@ -1,8 +1,8 @@ WORKDIR /var/www/html -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ +RUN set -ex; \ + 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; \ @@ -14,8 +14,8 @@ RUN set -ex \ echo '[global]'; \ echo 'include=etc/php-fpm.d/*.conf'; \ } | tee php-fpm.conf; \ - fi \ - && { \ + 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'; \ @@ -29,8 +29,8 @@ RUN set -ex \ 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 \ - && { \ + } | tee php-fpm.d/docker.conf; \ + { \ echo '[global]'; \ echo 'daemonize = no'; \ echo; \ From 250c2d872d4d52770ecdcecd0ff299c360031ed8 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 24 Jun 2019 14:55:17 -0700 Subject: [PATCH 2/2] Add "set -u" and more consistency --- 7.1/alpine3.10/cli/Dockerfile | 16 +++++++--------- 7.1/alpine3.10/fpm/Dockerfile | 18 ++++++++---------- 7.1/alpine3.10/zts/Dockerfile | 16 +++++++--------- 7.1/alpine3.9/cli/Dockerfile | 16 +++++++--------- 7.1/alpine3.9/fpm/Dockerfile | 18 ++++++++---------- 7.1/alpine3.9/zts/Dockerfile | 16 +++++++--------- 7.1/stretch/apache/Dockerfile | 22 +++++++++------------- 7.1/stretch/cli/Dockerfile | 22 +++++++++------------- 7.1/stretch/fpm/Dockerfile | 24 ++++++++++-------------- 7.1/stretch/zts/Dockerfile | 22 +++++++++------------- 7.2/alpine3.10/cli/Dockerfile | 16 +++++++--------- 7.2/alpine3.10/fpm/Dockerfile | 18 ++++++++---------- 7.2/alpine3.10/zts/Dockerfile | 16 +++++++--------- 7.2/alpine3.9/cli/Dockerfile | 16 +++++++--------- 7.2/alpine3.9/fpm/Dockerfile | 18 ++++++++---------- 7.2/alpine3.9/zts/Dockerfile | 16 +++++++--------- 7.2/stretch/apache/Dockerfile | 22 +++++++++------------- 7.2/stretch/cli/Dockerfile | 22 +++++++++------------- 7.2/stretch/fpm/Dockerfile | 24 ++++++++++-------------- 7.2/stretch/zts/Dockerfile | 22 +++++++++------------- 7.3/alpine3.10/cli/Dockerfile | 16 +++++++--------- 7.3/alpine3.10/fpm/Dockerfile | 18 ++++++++---------- 7.3/alpine3.10/zts/Dockerfile | 16 +++++++--------- 7.3/alpine3.9/cli/Dockerfile | 16 +++++++--------- 7.3/alpine3.9/fpm/Dockerfile | 18 ++++++++---------- 7.3/alpine3.9/zts/Dockerfile | 16 +++++++--------- 7.3/stretch/apache/Dockerfile | 22 +++++++++------------- 7.3/stretch/cli/Dockerfile | 22 +++++++++------------- 7.3/stretch/fpm/Dockerfile | 24 ++++++++++-------------- 7.3/stretch/zts/Dockerfile | 22 +++++++++------------- 7.4-rc/alpine3.10/cli/Dockerfile | 16 +++++++--------- 7.4-rc/alpine3.10/fpm/Dockerfile | 18 ++++++++---------- 7.4-rc/alpine3.10/zts/Dockerfile | 16 +++++++--------- 7.4-rc/alpine3.9/cli/Dockerfile | 16 +++++++--------- 7.4-rc/alpine3.9/fpm/Dockerfile | 18 ++++++++---------- 7.4-rc/alpine3.9/zts/Dockerfile | 16 +++++++--------- 7.4-rc/stretch/apache/Dockerfile | 22 +++++++++------------- 7.4-rc/stretch/cli/Dockerfile | 22 +++++++++------------- 7.4-rc/stretch/fpm/Dockerfile | 24 ++++++++++-------------- 7.4-rc/stretch/zts/Dockerfile | 22 +++++++++------------- Dockerfile-alpine.template | 16 +++++++--------- Dockerfile-debian.template | 22 +++++++++------------- fpm-Dockerfile-block-2 | 2 +- 43 files changed, 341 insertions(+), 459 deletions(-) diff --git a/7.1/alpine3.10/cli/Dockerfile b/7.1/alpine3.10/cli/Dockerfile index 2254b3df2..e5ac5b525 100644 --- a/7.1/alpine3.10/cli/Dockerfile +++ b/7.1/alpine3.10/cli/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -65,11 +65,9 @@ ENV PHP_VERSION 7.1.30 ENV PHP_URL="https://www.php.net/get/php-7.1.30.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.1.30.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -90,7 +88,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -98,7 +96,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ coreutils \ @@ -143,12 +141,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.1/alpine3.10/fpm/Dockerfile b/7.1/alpine3.10/fpm/Dockerfile index 90e6b5868..e0986d5b0 100644 --- a/7.1/alpine3.10/fpm/Dockerfile +++ b/7.1/alpine3.10/fpm/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.1.30 ENV PHP_URL="https://www.php.net/get/php-7.1.30.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.1.30.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ coreutils \ @@ -144,12 +142,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) @@ -180,7 +178,7 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex; \ +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" diff --git a/7.1/alpine3.10/zts/Dockerfile b/7.1/alpine3.10/zts/Dockerfile index 59e5b31f1..079f5e244 100644 --- a/7.1/alpine3.10/zts/Dockerfile +++ b/7.1/alpine3.10/zts/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.1.30 ENV PHP_URL="https://www.php.net/get/php-7.1.30.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.1.30.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ coreutils \ @@ -144,12 +142,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.1/alpine3.9/cli/Dockerfile b/7.1/alpine3.9/cli/Dockerfile index 44b9717b4..3654010e7 100644 --- a/7.1/alpine3.9/cli/Dockerfile +++ b/7.1/alpine3.9/cli/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -65,11 +65,9 @@ ENV PHP_VERSION 7.1.30 ENV PHP_URL="https://www.php.net/get/php-7.1.30.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.1.30.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -90,7 +88,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -98,7 +96,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ coreutils \ @@ -143,12 +141,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.1/alpine3.9/fpm/Dockerfile b/7.1/alpine3.9/fpm/Dockerfile index 12df001f8..069c93313 100644 --- a/7.1/alpine3.9/fpm/Dockerfile +++ b/7.1/alpine3.9/fpm/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.1.30 ENV PHP_URL="https://www.php.net/get/php-7.1.30.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.1.30.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ coreutils \ @@ -144,12 +142,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) @@ -180,7 +178,7 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex; \ +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" diff --git a/7.1/alpine3.9/zts/Dockerfile b/7.1/alpine3.9/zts/Dockerfile index 07a14db4b..1813035e0 100644 --- a/7.1/alpine3.9/zts/Dockerfile +++ b/7.1/alpine3.9/zts/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.1.30 ENV PHP_URL="https://www.php.net/get/php-7.1.30.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.1.30.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ coreutils \ @@ -144,12 +142,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.1/stretch/apache/Dockerfile b/7.1/stretch/apache/Dockerfile index 0223674dc..4f9628071 100644 --- a/7.1/stretch/apache/Dockerfile +++ b/7.1/stretch/apache/Dockerfile @@ -127,18 +127,12 @@ ENV PHP_VERSION 7.1.30 ENV PHP_URL="https://www.php.net/get/php-7.1.30.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.1.30.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -159,11 +153,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/7.1/stretch/cli/Dockerfile b/7.1/stretch/cli/Dockerfile index 7621790db..65c1fbfcc 100644 --- a/7.1/stretch/cli/Dockerfile +++ b/7.1/stretch/cli/Dockerfile @@ -67,18 +67,12 @@ ENV PHP_VERSION 7.1.30 ENV PHP_URL="https://www.php.net/get/php-7.1.30.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.1.30.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -99,11 +93,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/7.1/stretch/fpm/Dockerfile b/7.1/stretch/fpm/Dockerfile index 967195906..b0fa4ede3 100644 --- a/7.1/stretch/fpm/Dockerfile +++ b/7.1/stretch/fpm/Dockerfile @@ -68,18 +68,12 @@ ENV PHP_VERSION 7.1.30 ENV PHP_URL="https://www.php.net/get/php-7.1.30.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.1.30.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -100,11 +94,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ @@ -203,7 +199,7 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex; \ +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" diff --git a/7.1/stretch/zts/Dockerfile b/7.1/stretch/zts/Dockerfile index 23da5daa1..6fa14c82f 100644 --- a/7.1/stretch/zts/Dockerfile +++ b/7.1/stretch/zts/Dockerfile @@ -68,18 +68,12 @@ ENV PHP_VERSION 7.1.30 ENV PHP_URL="https://www.php.net/get/php-7.1.30.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.1.30.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="6310599811536dbe87e4bcf212bf93196bdfaff519d0c821e4c0068efd096a7c" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -100,11 +94,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/7.2/alpine3.10/cli/Dockerfile b/7.2/alpine3.10/cli/Dockerfile index 865b11041..96abb125d 100644 --- a/7.2/alpine3.10/cli/Dockerfile +++ b/7.2/alpine3.10/cli/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -65,11 +65,9 @@ ENV PHP_VERSION 7.2.19 ENV PHP_URL="https://www.php.net/get/php-7.2.19.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.19.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -90,7 +88,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -98,7 +96,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -149,12 +147,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.2/alpine3.10/fpm/Dockerfile b/7.2/alpine3.10/fpm/Dockerfile index 8579603bc..0a15aeeaa 100644 --- a/7.2/alpine3.10/fpm/Dockerfile +++ b/7.2/alpine3.10/fpm/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.2.19 ENV PHP_URL="https://www.php.net/get/php-7.2.19.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.19.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -150,12 +148,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) @@ -189,7 +187,7 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex; \ +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" diff --git a/7.2/alpine3.10/zts/Dockerfile b/7.2/alpine3.10/zts/Dockerfile index c69667a1c..e82603736 100644 --- a/7.2/alpine3.10/zts/Dockerfile +++ b/7.2/alpine3.10/zts/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.2.19 ENV PHP_URL="https://www.php.net/get/php-7.2.19.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.19.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -150,12 +148,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.2/alpine3.9/cli/Dockerfile b/7.2/alpine3.9/cli/Dockerfile index 0a0f6d230..5b14480f0 100644 --- a/7.2/alpine3.9/cli/Dockerfile +++ b/7.2/alpine3.9/cli/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -65,11 +65,9 @@ ENV PHP_VERSION 7.2.19 ENV PHP_URL="https://www.php.net/get/php-7.2.19.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.19.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -90,7 +88,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -98,7 +96,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -149,12 +147,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.2/alpine3.9/fpm/Dockerfile b/7.2/alpine3.9/fpm/Dockerfile index 593ece094..b8a4fa835 100644 --- a/7.2/alpine3.9/fpm/Dockerfile +++ b/7.2/alpine3.9/fpm/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.2.19 ENV PHP_URL="https://www.php.net/get/php-7.2.19.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.19.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -150,12 +148,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) @@ -189,7 +187,7 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex; \ +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" diff --git a/7.2/alpine3.9/zts/Dockerfile b/7.2/alpine3.9/zts/Dockerfile index b07b45458..7fffc0f2e 100644 --- a/7.2/alpine3.9/zts/Dockerfile +++ b/7.2/alpine3.9/zts/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.2.19 ENV PHP_URL="https://www.php.net/get/php-7.2.19.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.19.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -150,12 +148,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.2/stretch/apache/Dockerfile b/7.2/stretch/apache/Dockerfile index 2785eb549..4d59e528c 100644 --- a/7.2/stretch/apache/Dockerfile +++ b/7.2/stretch/apache/Dockerfile @@ -127,18 +127,12 @@ ENV PHP_VERSION 7.2.19 ENV PHP_URL="https://www.php.net/get/php-7.2.19.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.19.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -159,11 +153,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/7.2/stretch/cli/Dockerfile b/7.2/stretch/cli/Dockerfile index 6c20b7b90..1d9eaa510 100644 --- a/7.2/stretch/cli/Dockerfile +++ b/7.2/stretch/cli/Dockerfile @@ -67,18 +67,12 @@ ENV PHP_VERSION 7.2.19 ENV PHP_URL="https://www.php.net/get/php-7.2.19.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.19.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -99,11 +93,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/7.2/stretch/fpm/Dockerfile b/7.2/stretch/fpm/Dockerfile index 8696f8db5..e3712a123 100644 --- a/7.2/stretch/fpm/Dockerfile +++ b/7.2/stretch/fpm/Dockerfile @@ -68,18 +68,12 @@ ENV PHP_VERSION 7.2.19 ENV PHP_URL="https://www.php.net/get/php-7.2.19.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.19.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -100,11 +94,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ @@ -225,7 +221,7 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex; \ +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" diff --git a/7.2/stretch/zts/Dockerfile b/7.2/stretch/zts/Dockerfile index 677c0a276..4d218f40f 100644 --- a/7.2/stretch/zts/Dockerfile +++ b/7.2/stretch/zts/Dockerfile @@ -68,18 +68,12 @@ ENV PHP_VERSION 7.2.19 ENV PHP_URL="https://www.php.net/get/php-7.2.19.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.19.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="4ffa2404a88d60e993a9fe69f829ebec3eb1e006de41b6048ce5e91bbeaa9282" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -100,11 +94,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/7.3/alpine3.10/cli/Dockerfile b/7.3/alpine3.10/cli/Dockerfile index 2dcc0c60e..e301fb65f 100644 --- a/7.3/alpine3.10/cli/Dockerfile +++ b/7.3/alpine3.10/cli/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -65,11 +65,9 @@ ENV PHP_VERSION 7.3.6 ENV PHP_URL="https://www.php.net/get/php-7.3.6.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.3.6.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -90,7 +88,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -98,7 +96,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -149,12 +147,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.3/alpine3.10/fpm/Dockerfile b/7.3/alpine3.10/fpm/Dockerfile index 4714d5a6e..66d077db9 100644 --- a/7.3/alpine3.10/fpm/Dockerfile +++ b/7.3/alpine3.10/fpm/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.3.6 ENV PHP_URL="https://www.php.net/get/php-7.3.6.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.3.6.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -150,12 +148,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) @@ -189,7 +187,7 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex; \ +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" diff --git a/7.3/alpine3.10/zts/Dockerfile b/7.3/alpine3.10/zts/Dockerfile index 77d62bb4e..b55daa37e 100644 --- a/7.3/alpine3.10/zts/Dockerfile +++ b/7.3/alpine3.10/zts/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.3.6 ENV PHP_URL="https://www.php.net/get/php-7.3.6.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.3.6.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -150,12 +148,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.3/alpine3.9/cli/Dockerfile b/7.3/alpine3.9/cli/Dockerfile index be9d318ce..65ea4e9c2 100644 --- a/7.3/alpine3.9/cli/Dockerfile +++ b/7.3/alpine3.9/cli/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -65,11 +65,9 @@ ENV PHP_VERSION 7.3.6 ENV PHP_URL="https://www.php.net/get/php-7.3.6.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.3.6.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -90,7 +88,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -98,7 +96,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -149,12 +147,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.3/alpine3.9/fpm/Dockerfile b/7.3/alpine3.9/fpm/Dockerfile index 231d3facf..e9d167e0d 100644 --- a/7.3/alpine3.9/fpm/Dockerfile +++ b/7.3/alpine3.9/fpm/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.3.6 ENV PHP_URL="https://www.php.net/get/php-7.3.6.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.3.6.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -150,12 +148,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) @@ -189,7 +187,7 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex; \ +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" diff --git a/7.3/alpine3.9/zts/Dockerfile b/7.3/alpine3.9/zts/Dockerfile index 68cf21b7a..1a99cbf9b 100644 --- a/7.3/alpine3.9/zts/Dockerfile +++ b/7.3/alpine3.9/zts/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.3.6 ENV PHP_URL="https://www.php.net/get/php-7.3.6.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.3.6.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -150,12 +148,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.3/stretch/apache/Dockerfile b/7.3/stretch/apache/Dockerfile index 1039b60f3..a45724e57 100644 --- a/7.3/stretch/apache/Dockerfile +++ b/7.3/stretch/apache/Dockerfile @@ -127,18 +127,12 @@ ENV PHP_VERSION 7.3.6 ENV PHP_URL="https://www.php.net/get/php-7.3.6.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.3.6.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -159,11 +153,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/7.3/stretch/cli/Dockerfile b/7.3/stretch/cli/Dockerfile index f7c01fb8c..31710d352 100644 --- a/7.3/stretch/cli/Dockerfile +++ b/7.3/stretch/cli/Dockerfile @@ -67,18 +67,12 @@ ENV PHP_VERSION 7.3.6 ENV PHP_URL="https://www.php.net/get/php-7.3.6.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.3.6.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -99,11 +93,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/7.3/stretch/fpm/Dockerfile b/7.3/stretch/fpm/Dockerfile index 39d1578d1..e366e8a7b 100644 --- a/7.3/stretch/fpm/Dockerfile +++ b/7.3/stretch/fpm/Dockerfile @@ -68,18 +68,12 @@ ENV PHP_VERSION 7.3.6 ENV PHP_URL="https://www.php.net/get/php-7.3.6.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.3.6.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -100,11 +94,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ @@ -225,7 +221,7 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex; \ +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" diff --git a/7.3/stretch/zts/Dockerfile b/7.3/stretch/zts/Dockerfile index 25efaf217..53dca3f78 100644 --- a/7.3/stretch/zts/Dockerfile +++ b/7.3/stretch/zts/Dockerfile @@ -68,18 +68,12 @@ ENV PHP_VERSION 7.3.6 ENV PHP_URL="https://www.php.net/get/php-7.3.6.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.3.6.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="fefc8967daa30ebc375b2ab2857f97da94ca81921b722ddac86b29e15c54a164" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -100,11 +94,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/7.4-rc/alpine3.10/cli/Dockerfile b/7.4-rc/alpine3.10/cli/Dockerfile index dc063101e..96c62c571 100644 --- a/7.4-rc/alpine3.10/cli/Dockerfile +++ b/7.4-rc/alpine3.10/cli/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -65,11 +65,9 @@ ENV PHP_VERSION 7.4.0alpha1 ENV PHP_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz" PHP_ASC_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz.asc" ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -90,7 +88,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -98,7 +96,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -153,12 +151,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4-rc/alpine3.10/fpm/Dockerfile b/7.4-rc/alpine3.10/fpm/Dockerfile index 6d9728b12..30d56ee36 100644 --- a/7.4-rc/alpine3.10/fpm/Dockerfile +++ b/7.4-rc/alpine3.10/fpm/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.4.0alpha1 ENV PHP_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz" PHP_ASC_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz.asc" ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -154,12 +152,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) @@ -190,7 +188,7 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex; \ +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" diff --git a/7.4-rc/alpine3.10/zts/Dockerfile b/7.4-rc/alpine3.10/zts/Dockerfile index 4b0bf0d5e..eecb51ebe 100644 --- a/7.4-rc/alpine3.10/zts/Dockerfile +++ b/7.4-rc/alpine3.10/zts/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.4.0alpha1 ENV PHP_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz" PHP_ASC_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz.asc" ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -154,12 +152,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4-rc/alpine3.9/cli/Dockerfile b/7.4-rc/alpine3.9/cli/Dockerfile index 8954d8a6e..35fbdf6ec 100644 --- a/7.4-rc/alpine3.9/cli/Dockerfile +++ b/7.4-rc/alpine3.9/cli/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -65,11 +65,9 @@ ENV PHP_VERSION 7.4.0alpha1 ENV PHP_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz" PHP_ASC_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz.asc" ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -90,7 +88,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -98,7 +96,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -153,12 +151,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4-rc/alpine3.9/fpm/Dockerfile b/7.4-rc/alpine3.9/fpm/Dockerfile index 4a755b67f..22a23054a 100644 --- a/7.4-rc/alpine3.9/fpm/Dockerfile +++ b/7.4-rc/alpine3.9/fpm/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.4.0alpha1 ENV PHP_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz" PHP_ASC_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz.asc" ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -154,12 +152,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) @@ -190,7 +188,7 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex; \ +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" diff --git a/7.4-rc/alpine3.9/zts/Dockerfile b/7.4-rc/alpine3.9/zts/Dockerfile index a7611c05a..0fabde955 100644 --- a/7.4-rc/alpine3.9/zts/Dockerfile +++ b/7.4-rc/alpine3.9/zts/Dockerfile @@ -29,7 +29,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -66,11 +66,9 @@ ENV PHP_VERSION 7.4.0alpha1 ENV PHP_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz" PHP_ASC_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz.asc" ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -91,7 +89,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -99,7 +97,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -154,12 +152,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4-rc/stretch/apache/Dockerfile b/7.4-rc/stretch/apache/Dockerfile index 067189ccf..6329a6624 100644 --- a/7.4-rc/stretch/apache/Dockerfile +++ b/7.4-rc/stretch/apache/Dockerfile @@ -127,18 +127,12 @@ ENV PHP_VERSION 7.4.0alpha1 ENV PHP_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz" PHP_ASC_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz.asc" ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -159,11 +153,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/7.4-rc/stretch/cli/Dockerfile b/7.4-rc/stretch/cli/Dockerfile index 27e3eddd1..9c9f9f243 100644 --- a/7.4-rc/stretch/cli/Dockerfile +++ b/7.4-rc/stretch/cli/Dockerfile @@ -67,18 +67,12 @@ ENV PHP_VERSION 7.4.0alpha1 ENV PHP_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz" PHP_ASC_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz.asc" ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -99,11 +93,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/7.4-rc/stretch/fpm/Dockerfile b/7.4-rc/stretch/fpm/Dockerfile index 7411cb549..70793c5cd 100644 --- a/7.4-rc/stretch/fpm/Dockerfile +++ b/7.4-rc/stretch/fpm/Dockerfile @@ -68,18 +68,12 @@ ENV PHP_VERSION 7.4.0alpha1 ENV PHP_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz" PHP_ASC_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz.asc" ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -100,11 +94,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ @@ -223,7 +219,7 @@ ENTRYPOINT ["docker-php-entrypoint"] #### WORKDIR /var/www/html -RUN set -ex; \ +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" diff --git a/7.4-rc/stretch/zts/Dockerfile b/7.4-rc/stretch/zts/Dockerfile index 695f18cfa..20c6c63c6 100644 --- a/7.4-rc/stretch/zts/Dockerfile +++ b/7.4-rc/stretch/zts/Dockerfile @@ -68,18 +68,12 @@ ENV PHP_VERSION 7.4.0alpha1 ENV PHP_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz" PHP_ASC_URL="https://downloads.php.net/~derick/php-7.4.0alpha1.tar.xz.asc" ENV PHP_SHA256="378400b6eced6e358f5db750413a7f9959517b0daef6580b16d640190b7dc364" PHP_MD5="" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -100,11 +94,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 69c6fcca4..57442bd7f 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -23,7 +23,7 @@ RUN apk add --no-cache \ openssl # ensure www-data user exists -RUN set -xe; \ +RUN set -eux; \ addgroup -g 82 -S www-data; \ adduser -u 82 -D -S -G www-data www-data # 82 is the standard uid/gid for "www-data" in Alpine @@ -59,11 +59,9 @@ ENV PHP_VERSION %%PHP_VERSION%% ENV PHP_URL="%%PHP_URL%%" PHP_ASC_URL="%%PHP_ASC_URL%%" ENV PHP_SHA256="%%PHP_SHA256%%" PHP_MD5="%%PHP_MD5%%" -RUN set -xe; \ +RUN set -eux; \ \ - apk add --no-cache --virtual .fetch-deps \ - gnupg \ - ; \ + apk add --no-cache --virtual .fetch-deps gnupg; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -84,7 +82,7 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ @@ -92,7 +90,7 @@ RUN set -xe; \ COPY docker-php-source /usr/local/bin/ -RUN set -xe; \ +RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ argon2-dev \ @@ -147,12 +145,12 @@ RUN set -xe; \ # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ \ - $PHP_EXTRA_CONFIGURE_ARGS \ + ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ make -j "$(nproc)"; \ find -type f -name '*.a' -delete; \ make install; \ - { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; }; \ + find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 7cbc8e43a..8c901b86f 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -61,18 +61,12 @@ ENV PHP_VERSION %%PHP_VERSION%% ENV PHP_URL="%%PHP_URL%%" PHP_ASC_URL="%%PHP_ASC_URL%%" ENV PHP_SHA256="%%PHP_SHA256%%" PHP_MD5="%%PHP_MD5%%" -RUN set -xe; \ +RUN set -eux; \ \ - if ! command -v gpg > /dev/null; then \ - fetchDeps=" \ - dirmngr \ - gnupg \ - "; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - fi; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + rm -rf /var/lib/apt/lists/*; \ \ mkdir -p /usr/src; \ cd /usr/src; \ @@ -93,11 +87,13 @@ RUN set -xe; \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ done; \ gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ + gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ fi; \ \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps + 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/ diff --git a/fpm-Dockerfile-block-2 b/fpm-Dockerfile-block-2 index 8e698a1b0..c0c143130 100644 --- a/fpm-Dockerfile-block-2 +++ b/fpm-Dockerfile-block-2 @@ -1,6 +1,6 @@ WORKDIR /var/www/html -RUN set -ex; \ +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"