diff --git a/.travis.yml b/.travis.yml index aa985b9c..fde8f5d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,13 +2,13 @@ language: bash services: docker env: - - VERSION=7.1 VARIANT= - - VERSION=7.1 VARIANT=alpine - - VERSION=7.1 VARIANT=apache - - VERSION=7.1 VARIANT=fpm - - VERSION=7.1 VARIANT=fpm/alpine - - VERSION=7.1 VARIANT=zts - - VERSION=7.1 VARIANT=zts/alpine + - VERSION=7.1-rc VARIANT= + - VERSION=7.1-rc VARIANT=alpine + - VERSION=7.1-rc VARIANT=apache + - VERSION=7.1-rc VARIANT=fpm + - VERSION=7.1-rc VARIANT=fpm/alpine + - VERSION=7.1-rc VARIANT=zts + - VERSION=7.1-rc VARIANT=zts/alpine - VERSION=7.0 VARIANT= - VERSION=7.0 VARIANT=alpine - VERSION=7.0 VARIANT=apache diff --git a/5.6/Dockerfile b/5.6/Dockerfile index e6276fcc..e2241710 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -35,20 +35,41 @@ RUN mkdir -p $PHP_INI_DIR/conf.d ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 ENV PHP_VERSION 5.6.27 -ENV PHP_FILENAME php-5.6.27.tar.xz -ENV PHP_SHA256 16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5 +ENV PHP_URL="https://secure.php.net/get/php-5.6.27.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-5.6.27.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5" PHP_MD5="9ce6efc96d5ab81ef808f8ed6b1f242d" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -84,7 +105,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/5.6/alpine/Dockerfile b/5.6/alpine/Dockerfile index 86ea5b11..760ca2c8 100644 --- a/5.6/alpine/Dockerfile +++ b/5.6/alpine/Dockerfile @@ -40,24 +40,39 @@ RUN mkdir -p $PHP_INI_DIR/conf.d ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 ENV PHP_VERSION 5.6.27 -ENV PHP_FILENAME php-5.6.27.tar.xz -ENV PHP_SHA256 16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5 +ENV PHP_URL="https://secure.php.net/get/php-5.6.27.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-5.6.27.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5" PHP_MD5="9ce6efc96d5ab81ef808f8ed6b1f242d" -RUN set -xe \ - && apk add --no-cache --virtual .fetch-deps \ +RUN set -xe; \ + \ + apk add --no-cache --virtual .fetch-deps \ gnupg \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" \ - && apk del .fetch-deps + openssl \ + ; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + wget -O php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apk del .fetch-deps COPY docker-php-source /usr/local/bin/ @@ -91,7 +106,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(getconf _NPROCESSORS_ONLN)" \ + && make -j "$(getconf _NPROCESSORS_ONLN)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/5.6/apache/Dockerfile b/5.6/apache/Dockerfile index eb8a126a..725f9f67 100644 --- a/5.6/apache/Dockerfile +++ b/5.6/apache/Dockerfile @@ -91,20 +91,41 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 ENV PHP_VERSION 5.6.27 -ENV PHP_FILENAME php-5.6.27.tar.xz -ENV PHP_SHA256 16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5 +ENV PHP_URL="https://secure.php.net/get/php-5.6.27.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-5.6.27.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5" PHP_MD5="9ce6efc96d5ab81ef808f8ed6b1f242d" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -140,7 +161,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/5.6/fpm/Dockerfile b/5.6/fpm/Dockerfile index 9d0fca1f..9e978688 100644 --- a/5.6/fpm/Dockerfile +++ b/5.6/fpm/Dockerfile @@ -36,20 +36,41 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-gr ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 ENV PHP_VERSION 5.6.27 -ENV PHP_FILENAME php-5.6.27.tar.xz -ENV PHP_SHA256 16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5 +ENV PHP_URL="https://secure.php.net/get/php-5.6.27.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-5.6.27.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5" PHP_MD5="9ce6efc96d5ab81ef808f8ed6b1f242d" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -85,7 +106,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/5.6/fpm/alpine/Dockerfile b/5.6/fpm/alpine/Dockerfile index 38ce85f9..d6122bd3 100644 --- a/5.6/fpm/alpine/Dockerfile +++ b/5.6/fpm/alpine/Dockerfile @@ -41,24 +41,39 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-gr ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 ENV PHP_VERSION 5.6.27 -ENV PHP_FILENAME php-5.6.27.tar.xz -ENV PHP_SHA256 16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5 +ENV PHP_URL="https://secure.php.net/get/php-5.6.27.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-5.6.27.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5" PHP_MD5="9ce6efc96d5ab81ef808f8ed6b1f242d" -RUN set -xe \ - && apk add --no-cache --virtual .fetch-deps \ +RUN set -xe; \ + \ + apk add --no-cache --virtual .fetch-deps \ gnupg \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" \ - && apk del .fetch-deps + openssl \ + ; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + wget -O php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apk del .fetch-deps COPY docker-php-source /usr/local/bin/ @@ -92,7 +107,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(getconf _NPROCESSORS_ONLN)" \ + && make -j "$(getconf _NPROCESSORS_ONLN)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/5.6/zts/Dockerfile b/5.6/zts/Dockerfile index b3b62176..b37ae056 100644 --- a/5.6/zts/Dockerfile +++ b/5.6/zts/Dockerfile @@ -36,20 +36,41 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 ENV PHP_VERSION 5.6.27 -ENV PHP_FILENAME php-5.6.27.tar.xz -ENV PHP_SHA256 16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5 +ENV PHP_URL="https://secure.php.net/get/php-5.6.27.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-5.6.27.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5" PHP_MD5="9ce6efc96d5ab81ef808f8ed6b1f242d" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -85,7 +106,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/5.6/zts/alpine/Dockerfile b/5.6/zts/alpine/Dockerfile index 5c7108c7..6df60eab 100644 --- a/5.6/zts/alpine/Dockerfile +++ b/5.6/zts/alpine/Dockerfile @@ -41,24 +41,39 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 ENV PHP_VERSION 5.6.27 -ENV PHP_FILENAME php-5.6.27.tar.xz -ENV PHP_SHA256 16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5 +ENV PHP_URL="https://secure.php.net/get/php-5.6.27.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-5.6.27.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5" PHP_MD5="9ce6efc96d5ab81ef808f8ed6b1f242d" -RUN set -xe \ - && apk add --no-cache --virtual .fetch-deps \ +RUN set -xe; \ + \ + apk add --no-cache --virtual .fetch-deps \ gnupg \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" \ - && apk del .fetch-deps + openssl \ + ; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + wget -O php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apk del .fetch-deps COPY docker-php-source /usr/local/bin/ @@ -92,7 +107,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(getconf _NPROCESSORS_ONLN)" \ + && make -j "$(getconf _NPROCESSORS_ONLN)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.0/Dockerfile b/7.0/Dockerfile index 87c1916a..ed0466bb 100644 --- a/7.0/Dockerfile +++ b/7.0/Dockerfile @@ -35,20 +35,41 @@ RUN mkdir -p $PHP_INI_DIR/conf.d ENV GPG_KEYS 1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 ENV PHP_VERSION 7.0.12 -ENV PHP_FILENAME php-7.0.12.tar.xz -ENV PHP_SHA256 f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff +ENV PHP_URL="https://secure.php.net/get/php-7.0.12.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-7.0.12.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff" PHP_MD5="bdcc4dbdac90c2a39422786653059f70" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -84,7 +105,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.0/alpine/Dockerfile b/7.0/alpine/Dockerfile index 071feb62..678bef12 100644 --- a/7.0/alpine/Dockerfile +++ b/7.0/alpine/Dockerfile @@ -40,24 +40,39 @@ RUN mkdir -p $PHP_INI_DIR/conf.d ENV GPG_KEYS 1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 ENV PHP_VERSION 7.0.12 -ENV PHP_FILENAME php-7.0.12.tar.xz -ENV PHP_SHA256 f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff +ENV PHP_URL="https://secure.php.net/get/php-7.0.12.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-7.0.12.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff" PHP_MD5="bdcc4dbdac90c2a39422786653059f70" -RUN set -xe \ - && apk add --no-cache --virtual .fetch-deps \ +RUN set -xe; \ + \ + apk add --no-cache --virtual .fetch-deps \ gnupg \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" \ - && apk del .fetch-deps + openssl \ + ; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + wget -O php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apk del .fetch-deps COPY docker-php-source /usr/local/bin/ @@ -91,7 +106,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(getconf _NPROCESSORS_ONLN)" \ + && make -j "$(getconf _NPROCESSORS_ONLN)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.0/apache/Dockerfile b/7.0/apache/Dockerfile index 1e6537ec..e9e513e3 100644 --- a/7.0/apache/Dockerfile +++ b/7.0/apache/Dockerfile @@ -91,20 +91,41 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 ENV GPG_KEYS 1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 ENV PHP_VERSION 7.0.12 -ENV PHP_FILENAME php-7.0.12.tar.xz -ENV PHP_SHA256 f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff +ENV PHP_URL="https://secure.php.net/get/php-7.0.12.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-7.0.12.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff" PHP_MD5="bdcc4dbdac90c2a39422786653059f70" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -140,7 +161,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.0/fpm/Dockerfile b/7.0/fpm/Dockerfile index ab4c0bd2..5eb0d50b 100644 --- a/7.0/fpm/Dockerfile +++ b/7.0/fpm/Dockerfile @@ -36,20 +36,41 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-gr ENV GPG_KEYS 1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 ENV PHP_VERSION 7.0.12 -ENV PHP_FILENAME php-7.0.12.tar.xz -ENV PHP_SHA256 f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff +ENV PHP_URL="https://secure.php.net/get/php-7.0.12.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-7.0.12.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff" PHP_MD5="bdcc4dbdac90c2a39422786653059f70" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -85,7 +106,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.0/fpm/alpine/Dockerfile b/7.0/fpm/alpine/Dockerfile index ef086d91..6d97ea02 100644 --- a/7.0/fpm/alpine/Dockerfile +++ b/7.0/fpm/alpine/Dockerfile @@ -41,24 +41,39 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-gr ENV GPG_KEYS 1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 ENV PHP_VERSION 7.0.12 -ENV PHP_FILENAME php-7.0.12.tar.xz -ENV PHP_SHA256 f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff +ENV PHP_URL="https://secure.php.net/get/php-7.0.12.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-7.0.12.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff" PHP_MD5="bdcc4dbdac90c2a39422786653059f70" -RUN set -xe \ - && apk add --no-cache --virtual .fetch-deps \ +RUN set -xe; \ + \ + apk add --no-cache --virtual .fetch-deps \ gnupg \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" \ - && apk del .fetch-deps + openssl \ + ; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + wget -O php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apk del .fetch-deps COPY docker-php-source /usr/local/bin/ @@ -92,7 +107,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(getconf _NPROCESSORS_ONLN)" \ + && make -j "$(getconf _NPROCESSORS_ONLN)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.0/zts/Dockerfile b/7.0/zts/Dockerfile index 8642d03d..966ae8b3 100644 --- a/7.0/zts/Dockerfile +++ b/7.0/zts/Dockerfile @@ -36,20 +36,41 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts ENV GPG_KEYS 1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 ENV PHP_VERSION 7.0.12 -ENV PHP_FILENAME php-7.0.12.tar.xz -ENV PHP_SHA256 f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff +ENV PHP_URL="https://secure.php.net/get/php-7.0.12.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-7.0.12.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff" PHP_MD5="bdcc4dbdac90c2a39422786653059f70" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -85,7 +106,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.0/zts/alpine/Dockerfile b/7.0/zts/alpine/Dockerfile index a41b6584..1cbe3833 100644 --- a/7.0/zts/alpine/Dockerfile +++ b/7.0/zts/alpine/Dockerfile @@ -41,24 +41,39 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts ENV GPG_KEYS 1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 ENV PHP_VERSION 7.0.12 -ENV PHP_FILENAME php-7.0.12.tar.xz -ENV PHP_SHA256 f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff +ENV PHP_URL="https://secure.php.net/get/php-7.0.12.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-7.0.12.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="f3d6c49e1c242e5995dec15e503fde996c327eb86cd7ec45c690e93c971b83ff" PHP_MD5="bdcc4dbdac90c2a39422786653059f70" -RUN set -xe \ - && apk add --no-cache --virtual .fetch-deps \ +RUN set -xe; \ + \ + apk add --no-cache --virtual .fetch-deps \ gnupg \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" \ - && apk del .fetch-deps + openssl \ + ; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + wget -O php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apk del .fetch-deps COPY docker-php-source /usr/local/bin/ @@ -92,7 +107,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(getconf _NPROCESSORS_ONLN)" \ + && make -j "$(getconf _NPROCESSORS_ONLN)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.1/Dockerfile b/7.1-rc/Dockerfile similarity index 69% rename from 7.1/Dockerfile rename to 7.1-rc/Dockerfile index 75970b70..5b6e49cd 100644 --- a/7.1/Dockerfile +++ b/7.1-rc/Dockerfile @@ -35,18 +35,41 @@ RUN mkdir -p $PHP_INI_DIR/conf.d ENV GPG_KEYS A917B1ECDA84AEC2B568FED6F50ABC807BD5DCD0 ENV PHP_VERSION 7.1.0RC3 -ENV PHP_FILENAME php-7.1.0RC3.tar.xz +ENV PHP_URL="http://downloads.php.net/~davey/php-7.1.0RC3.tar.xz" PHP_ASC_URL="" +ENV PHP_SHA256="" PHP_MD5="2bfa0ad51de4fce87d0175d655f6bf69" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME" -o php.tar.xz \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME.asc" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -82,7 +105,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.1/alpine/Dockerfile b/7.1-rc/alpine/Dockerfile similarity index 75% rename from 7.1/alpine/Dockerfile rename to 7.1-rc/alpine/Dockerfile index 5a7c2d2a..5e0838c8 100644 --- a/7.1/alpine/Dockerfile +++ b/7.1-rc/alpine/Dockerfile @@ -40,22 +40,39 @@ RUN mkdir -p $PHP_INI_DIR/conf.d ENV GPG_KEYS A917B1ECDA84AEC2B568FED6F50ABC807BD5DCD0 ENV PHP_VERSION 7.1.0RC3 -ENV PHP_FILENAME php-7.1.0RC3.tar.xz +ENV PHP_URL="http://downloads.php.net/~davey/php-7.1.0RC3.tar.xz" PHP_ASC_URL="" +ENV PHP_SHA256="" PHP_MD5="2bfa0ad51de4fce87d0175d655f6bf69" -RUN set -xe \ - && apk add --no-cache --virtual .fetch-deps \ +RUN set -xe; \ + \ + apk add --no-cache --virtual .fetch-deps \ gnupg \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME" -o php.tar.xz \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME.asc" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" \ - && apk del .fetch-deps + openssl \ + ; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + wget -O php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apk del .fetch-deps COPY docker-php-source /usr/local/bin/ @@ -89,7 +106,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(getconf _NPROCESSORS_ONLN)" \ + && make -j "$(getconf _NPROCESSORS_ONLN)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.1/alpine/docker-php-ext-configure b/7.1-rc/alpine/docker-php-ext-configure similarity index 100% rename from 7.1/alpine/docker-php-ext-configure rename to 7.1-rc/alpine/docker-php-ext-configure diff --git a/7.1/alpine/docker-php-ext-enable b/7.1-rc/alpine/docker-php-ext-enable similarity index 100% rename from 7.1/alpine/docker-php-ext-enable rename to 7.1-rc/alpine/docker-php-ext-enable diff --git a/7.1/alpine/docker-php-ext-install b/7.1-rc/alpine/docker-php-ext-install similarity index 100% rename from 7.1/alpine/docker-php-ext-install rename to 7.1-rc/alpine/docker-php-ext-install diff --git a/7.1/alpine/docker-php-source b/7.1-rc/alpine/docker-php-source similarity index 100% rename from 7.1/alpine/docker-php-source rename to 7.1-rc/alpine/docker-php-source diff --git a/7.1/apache/Dockerfile b/7.1-rc/apache/Dockerfile similarity index 80% rename from 7.1/apache/Dockerfile rename to 7.1-rc/apache/Dockerfile index 09542dd0..415d7eea 100644 --- a/7.1/apache/Dockerfile +++ b/7.1-rc/apache/Dockerfile @@ -91,18 +91,41 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 ENV GPG_KEYS A917B1ECDA84AEC2B568FED6F50ABC807BD5DCD0 ENV PHP_VERSION 7.1.0RC3 -ENV PHP_FILENAME php-7.1.0RC3.tar.xz +ENV PHP_URL="http://downloads.php.net/~davey/php-7.1.0RC3.tar.xz" PHP_ASC_URL="" +ENV PHP_SHA256="" PHP_MD5="2bfa0ad51de4fce87d0175d655f6bf69" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME" -o php.tar.xz \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME.asc" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -138,7 +161,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.1/apache/apache2-foreground b/7.1-rc/apache/apache2-foreground similarity index 100% rename from 7.1/apache/apache2-foreground rename to 7.1-rc/apache/apache2-foreground diff --git a/7.1/apache/docker-php-ext-configure b/7.1-rc/apache/docker-php-ext-configure similarity index 100% rename from 7.1/apache/docker-php-ext-configure rename to 7.1-rc/apache/docker-php-ext-configure diff --git a/7.1/apache/docker-php-ext-enable b/7.1-rc/apache/docker-php-ext-enable similarity index 100% rename from 7.1/apache/docker-php-ext-enable rename to 7.1-rc/apache/docker-php-ext-enable diff --git a/7.1/apache/docker-php-ext-install b/7.1-rc/apache/docker-php-ext-install similarity index 100% rename from 7.1/apache/docker-php-ext-install rename to 7.1-rc/apache/docker-php-ext-install diff --git a/7.1/apache/docker-php-source b/7.1-rc/apache/docker-php-source similarity index 100% rename from 7.1/apache/docker-php-source rename to 7.1-rc/apache/docker-php-source diff --git a/7.1/docker-php-ext-configure b/7.1-rc/docker-php-ext-configure similarity index 100% rename from 7.1/docker-php-ext-configure rename to 7.1-rc/docker-php-ext-configure diff --git a/7.1/docker-php-ext-enable b/7.1-rc/docker-php-ext-enable similarity index 100% rename from 7.1/docker-php-ext-enable rename to 7.1-rc/docker-php-ext-enable diff --git a/7.1/docker-php-ext-install b/7.1-rc/docker-php-ext-install similarity index 100% rename from 7.1/docker-php-ext-install rename to 7.1-rc/docker-php-ext-install diff --git a/7.1/docker-php-source b/7.1-rc/docker-php-source similarity index 100% rename from 7.1/docker-php-source rename to 7.1-rc/docker-php-source diff --git a/7.1/fpm/Dockerfile b/7.1-rc/fpm/Dockerfile similarity index 78% rename from 7.1/fpm/Dockerfile rename to 7.1-rc/fpm/Dockerfile index 415f5a5f..e874c187 100644 --- a/7.1/fpm/Dockerfile +++ b/7.1-rc/fpm/Dockerfile @@ -36,18 +36,41 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-gr ENV GPG_KEYS A917B1ECDA84AEC2B568FED6F50ABC807BD5DCD0 ENV PHP_VERSION 7.1.0RC3 -ENV PHP_FILENAME php-7.1.0RC3.tar.xz +ENV PHP_URL="http://downloads.php.net/~davey/php-7.1.0RC3.tar.xz" PHP_ASC_URL="" +ENV PHP_SHA256="" PHP_MD5="2bfa0ad51de4fce87d0175d655f6bf69" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME" -o php.tar.xz \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME.asc" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -83,7 +106,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.1/fpm/alpine/Dockerfile b/7.1-rc/fpm/alpine/Dockerfile similarity index 81% rename from 7.1/fpm/alpine/Dockerfile rename to 7.1-rc/fpm/alpine/Dockerfile index e9eecef6..106e784c 100644 --- a/7.1/fpm/alpine/Dockerfile +++ b/7.1-rc/fpm/alpine/Dockerfile @@ -41,22 +41,39 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-gr ENV GPG_KEYS A917B1ECDA84AEC2B568FED6F50ABC807BD5DCD0 ENV PHP_VERSION 7.1.0RC3 -ENV PHP_FILENAME php-7.1.0RC3.tar.xz +ENV PHP_URL="http://downloads.php.net/~davey/php-7.1.0RC3.tar.xz" PHP_ASC_URL="" +ENV PHP_SHA256="" PHP_MD5="2bfa0ad51de4fce87d0175d655f6bf69" -RUN set -xe \ - && apk add --no-cache --virtual .fetch-deps \ +RUN set -xe; \ + \ + apk add --no-cache --virtual .fetch-deps \ gnupg \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME" -o php.tar.xz \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME.asc" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" \ - && apk del .fetch-deps + openssl \ + ; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + wget -O php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apk del .fetch-deps COPY docker-php-source /usr/local/bin/ @@ -90,7 +107,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(getconf _NPROCESSORS_ONLN)" \ + && make -j "$(getconf _NPROCESSORS_ONLN)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.1/fpm/alpine/docker-php-ext-configure b/7.1-rc/fpm/alpine/docker-php-ext-configure similarity index 100% rename from 7.1/fpm/alpine/docker-php-ext-configure rename to 7.1-rc/fpm/alpine/docker-php-ext-configure diff --git a/7.1/fpm/alpine/docker-php-ext-enable b/7.1-rc/fpm/alpine/docker-php-ext-enable similarity index 100% rename from 7.1/fpm/alpine/docker-php-ext-enable rename to 7.1-rc/fpm/alpine/docker-php-ext-enable diff --git a/7.1/fpm/alpine/docker-php-ext-install b/7.1-rc/fpm/alpine/docker-php-ext-install similarity index 100% rename from 7.1/fpm/alpine/docker-php-ext-install rename to 7.1-rc/fpm/alpine/docker-php-ext-install diff --git a/7.1/fpm/alpine/docker-php-source b/7.1-rc/fpm/alpine/docker-php-source similarity index 100% rename from 7.1/fpm/alpine/docker-php-source rename to 7.1-rc/fpm/alpine/docker-php-source diff --git a/7.1/fpm/docker-php-ext-configure b/7.1-rc/fpm/docker-php-ext-configure similarity index 100% rename from 7.1/fpm/docker-php-ext-configure rename to 7.1-rc/fpm/docker-php-ext-configure diff --git a/7.1/fpm/docker-php-ext-enable b/7.1-rc/fpm/docker-php-ext-enable similarity index 100% rename from 7.1/fpm/docker-php-ext-enable rename to 7.1-rc/fpm/docker-php-ext-enable diff --git a/7.1/fpm/docker-php-ext-install b/7.1-rc/fpm/docker-php-ext-install similarity index 100% rename from 7.1/fpm/docker-php-ext-install rename to 7.1-rc/fpm/docker-php-ext-install diff --git a/7.1/fpm/docker-php-source b/7.1-rc/fpm/docker-php-source similarity index 100% rename from 7.1/fpm/docker-php-source rename to 7.1-rc/fpm/docker-php-source diff --git a/7.1/zts/Dockerfile b/7.1-rc/zts/Dockerfile similarity index 70% rename from 7.1/zts/Dockerfile rename to 7.1-rc/zts/Dockerfile index 3b4b75fd..cd44c854 100644 --- a/7.1/zts/Dockerfile +++ b/7.1-rc/zts/Dockerfile @@ -36,18 +36,41 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts ENV GPG_KEYS A917B1ECDA84AEC2B568FED6F50ABC807BD5DCD0 ENV PHP_VERSION 7.1.0RC3 -ENV PHP_FILENAME php-7.1.0RC3.tar.xz +ENV PHP_URL="http://downloads.php.net/~davey/php-7.1.0RC3.tar.xz" PHP_ASC_URL="" +ENV PHP_SHA256="" PHP_MD5="2bfa0ad51de4fce87d0175d655f6bf69" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME" -o php.tar.xz \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME.asc" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -83,7 +106,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.1/zts/alpine/Dockerfile b/7.1-rc/zts/alpine/Dockerfile similarity index 75% rename from 7.1/zts/alpine/Dockerfile rename to 7.1-rc/zts/alpine/Dockerfile index dafdbcb7..af1e6f90 100644 --- a/7.1/zts/alpine/Dockerfile +++ b/7.1-rc/zts/alpine/Dockerfile @@ -41,22 +41,39 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts ENV GPG_KEYS A917B1ECDA84AEC2B568FED6F50ABC807BD5DCD0 ENV PHP_VERSION 7.1.0RC3 -ENV PHP_FILENAME php-7.1.0RC3.tar.xz +ENV PHP_URL="http://downloads.php.net/~davey/php-7.1.0RC3.tar.xz" PHP_ASC_URL="" +ENV PHP_SHA256="" PHP_MD5="2bfa0ad51de4fce87d0175d655f6bf69" -RUN set -xe \ - && apk add --no-cache --virtual .fetch-deps \ +RUN set -xe; \ + \ + apk add --no-cache --virtual .fetch-deps \ gnupg \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME" -o php.tar.xz \ - && curl -fSL "https://downloads.php.net/~davey/$PHP_FILENAME.asc" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" \ - && apk del .fetch-deps + openssl \ + ; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + wget -O php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apk del .fetch-deps COPY docker-php-source /usr/local/bin/ @@ -90,7 +107,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(getconf _NPROCESSORS_ONLN)" \ + && make -j "$(getconf _NPROCESSORS_ONLN)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/7.1/zts/alpine/docker-php-ext-configure b/7.1-rc/zts/alpine/docker-php-ext-configure similarity index 100% rename from 7.1/zts/alpine/docker-php-ext-configure rename to 7.1-rc/zts/alpine/docker-php-ext-configure diff --git a/7.1/zts/alpine/docker-php-ext-enable b/7.1-rc/zts/alpine/docker-php-ext-enable similarity index 100% rename from 7.1/zts/alpine/docker-php-ext-enable rename to 7.1-rc/zts/alpine/docker-php-ext-enable diff --git a/7.1/zts/alpine/docker-php-ext-install b/7.1-rc/zts/alpine/docker-php-ext-install similarity index 100% rename from 7.1/zts/alpine/docker-php-ext-install rename to 7.1-rc/zts/alpine/docker-php-ext-install diff --git a/7.1/zts/alpine/docker-php-source b/7.1-rc/zts/alpine/docker-php-source similarity index 100% rename from 7.1/zts/alpine/docker-php-source rename to 7.1-rc/zts/alpine/docker-php-source diff --git a/7.1/zts/docker-php-ext-configure b/7.1-rc/zts/docker-php-ext-configure similarity index 100% rename from 7.1/zts/docker-php-ext-configure rename to 7.1-rc/zts/docker-php-ext-configure diff --git a/7.1/zts/docker-php-ext-enable b/7.1-rc/zts/docker-php-ext-enable similarity index 100% rename from 7.1/zts/docker-php-ext-enable rename to 7.1-rc/zts/docker-php-ext-enable diff --git a/7.1/zts/docker-php-ext-install b/7.1-rc/zts/docker-php-ext-install similarity index 100% rename from 7.1/zts/docker-php-ext-install rename to 7.1-rc/zts/docker-php-ext-install diff --git a/7.1/zts/docker-php-source b/7.1-rc/zts/docker-php-source similarity index 100% rename from 7.1/zts/docker-php-source rename to 7.1-rc/zts/docker-php-source diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 623a1331..97580078 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -34,24 +34,39 @@ RUN mkdir -p $PHP_INI_DIR/conf.d ENV GPG_KEYS %%GPG_KEYS%% ENV PHP_VERSION %%PHP_VERSION%% -ENV PHP_FILENAME %%PHP_FILENAME%% -ENV PHP_SHA256 %%PHP_SHA256%% +ENV PHP_URL="%%PHP_URL%%" PHP_ASC_URL="%%PHP_ASC_URL%%" +ENV PHP_SHA256="%%PHP_SHA256%%" PHP_MD5="%%PHP_MD5%%" -RUN set -xe \ - && apk add --no-cache --virtual .fetch-deps \ +RUN set -xe; \ + \ + apk add --no-cache --virtual .fetch-deps \ gnupg \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" \ - && apk del .fetch-deps + openssl \ + ; \ + \ + mkdir -p /usr/src; \ + cd /usr/src; \ + \ + wget -O php.tar.xz "$PHP_URL"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apk del .fetch-deps COPY docker-php-source /usr/local/bin/ @@ -85,7 +100,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(getconf _NPROCESSORS_ONLN)" \ + && make -j "$(getconf _NPROCESSORS_ONLN)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 49020f98..42738542 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -29,20 +29,41 @@ RUN mkdir -p $PHP_INI_DIR/conf.d ENV GPG_KEYS %%GPG_KEYS%% ENV PHP_VERSION %%PHP_VERSION%% -ENV PHP_FILENAME %%PHP_FILENAME%% -ENV PHP_SHA256 %%PHP_SHA256%% +ENV PHP_URL="%%PHP_URL%%" PHP_ASC_URL="%%PHP_ASC_URL%%" +ENV PHP_SHA256="%%PHP_SHA256%%" PHP_MD5="%%PHP_MD5%%" -RUN set -xe \ - && cd /usr/src \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz \ - && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - \ - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc \ - && export GNUPGHOME="$(mktemp -d)" \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done \ - && gpg --batch --verify php.tar.xz.asc php.tar.xz \ - && rm -r "$GNUPGHOME" +RUN set -xe; \ + \ + fetchDeps=' \ + wget \ + '; \ + 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"; \ + \ + if [ -n "$PHP_SHA256" ]; then \ + echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ + fi; \ + if [ -n "$PHP_MD5" ]; then \ + echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ + fi; \ + \ + if [ -n "$PHP_ASC_URL" ]; then \ + wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ + export GNUPGHOME="$(mktemp -d)"; \ + for key in $GPG_KEYS; do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + done; \ + gpg --batch --verify php.tar.xz.asc php.tar.xz; \ + rm -r "$GNUPGHOME"; \ + fi; \ + \ + apt-get purge -y --auto-remove $fetchDeps COPY docker-php-source /usr/local/bin/ @@ -78,7 +99,7 @@ RUN set -xe \ --with-zlib \ \ $PHP_EXTRA_CONFIGURE_ARGS \ - && make -j"$(nproc)" \ + && make -j "$(nproc)" \ && make install \ && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ && make clean \ diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 58d0ce91..1ff108f6 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -4,6 +4,7 @@ set -eu declare -A aliases=( [5.6]='5' [7.0]='7 latest' + [7.1-rc]='rc' ) self="$(basename "$BASH_SOURCE")" diff --git a/update.sh b/update.sh index 0e76759f..233c8293 100755 --- a/update.sh +++ b/update.sh @@ -35,49 +35,63 @@ generated_warning() { EOH } -jsonSh="$(curl -fsSL 'https://raw.githubusercontent.com/dominictarr/JSON.sh/ed3f9dd285ebd4183934adb54ea5a2fda6b25a98/JSON.sh')" - travisEnv= for version in "${versions[@]}"; do - packagesJson="$(curl -fsSL "https://secure.php.net/releases/index.php?json&max=100&version=${version%%.*}" | bash -- <(echo "$jsonSh") -l)" - fullVersion= - filename= - sha256= - for comp in xz bz2 gz; do - fullVersion="$( - echo "$packagesJson" \ - | grep '^\["'"$version"'[."].*,"filename"\].*\.'"$comp"'"' \ - | cut -d'"' -f2 \ - | head -1 - )" - if [ "$fullVersion" ]; then - sourceNumber="$( - echo "$packagesJson" \ - | grep '^\["'"$fullVersion"'","source",.*,"filename"\].*\.'"$comp"'"' \ - | cut -d, -f3 - )" - filename="$( - echo "$packagesJson" \ - | grep '^\["'"$fullVersion"'","source",'"$sourceNumber"',"filename"\]' \ - | cut -d$'\t' -f2 | cut -d'"' -f2 - )" - sha256="$( - echo "$packagesJson" \ - | grep '^\["'"$fullVersion"'","source",'"$sourceNumber"',"sha256"\]' \ - | cut -d$'\t' -f2 | cut -d'"' -f2 - )" - break - fi - done + rcVersion="${version%-rc}" - if [ -z "$fullVersion" ]; then + # scrape the relevant API based on whether we're looking for pre-releases + apiUrl="https://secure.php.net/releases/index.php?json&max=100&version=${rcVersion%%.*}" + apiJqExpr=' + (keys[] | select(startswith("'"$rcVersion"'."))) as $version + | [ $version, ( + .[$version].source[] + | select(.filename | endswith(".xz")) + | + "https://secure.php.net/get/" + .filename + "/from/this/mirror", + "https://secure.php.net/get/" + .filename + ".asc/from/this/mirror", + .sha256 // "", + .md5 // "" + ) ] + ' + if [ "$rcVersion" != "$version" ]; then + apiUrl='https://qa.php.net/api.php?type=qa-releases&format=json' + apiJqExpr=' + .releases[] + | select(.version | startswith("7.1.")) + | [ + .version, + .files.xz.path // "", + "", + .files.xz.sha256 // "", + .files.xz.md5 // "" + ] + ' + fi + IFS=$'\n' + possibles=( $( + curl -fsSL "$apiUrl" \ + | jq --raw-output "$apiJqExpr | @sh" \ + | sort -rV + ) ) + unset IFS + + if [ "${#possibles[@]}" -eq 0 ]; then echo >&2 - echo >&2 "warning: missing full version for $version; skipping" + echo >&2 "error: unable to determine available releases of $version" echo >&2 - continue + exit 1 fi - gpgKey="${gpgKeys[$version]}" + # format of "possibles" array entries is "VERSION URL.TAR.XZ URL.TAR.XZ.ASC SHA256 MD5" (each value shell quoted) + # see the "apiJqExpr" values above for more details + eval "possi=( ${possibles[0]} )" + fullVersion="${possi[0]}" + url="${possi[1]}" + ascUrl="${possi[2]}" + sha256="${possi[3]}" + md5="${possi[4]}" + + gpgKey="${gpgKeys[$rcVersion]}" if [ -z "$gpgKey" ]; then echo >&2 "ERROR: missing GPG key fingerprint for $version" echo >&2 " try looking on https://secure.php.net/downloads.php#gpg-$version" @@ -126,12 +140,14 @@ for version in "${versions[@]}"; do ( set -x - sed -ri ' - s!%%PHP_VERSION%%!'"$fullVersion"'!; - s!%%PHP_FILENAME%%!'"$filename"'!; - s!%%PHP_SHA256%%!'"$sha256"'!; - s!%%GPG_KEYS%%!'"$gpgKey"'!; - ' "${dockerfiles[@]}" + sed -ri \ + -e 's!%%PHP_VERSION%%!'"$fullVersion"'!' \ + -e 's!%%GPG_KEYS%%!'"$gpgKey"'!' \ + -e 's!%%PHP_URL%%!'"$url"'!' \ + -e 's!%%PHP_ASC_URL%%!'"$ascUrl"'!' \ + -e 's!%%PHP_SHA256%%!'"$sha256"'!' \ + -e 's!%%PHP_MD5%%!'"$md5"'!' \ + "${dockerfiles[@]}" ) newTravisEnv=