diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000..d0e5bbbb10
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,4 @@
+**/Dockerfile linguist-generated
+**/apache2-foreground linguist-generated
+**/docker-php-* linguist-generated
+Dockerfile*.template linguist-language=Dockerfile
diff --git a/.github/workflows/verify-templating.yml b/.github/workflows/verify-templating.yml
new file mode 100644
index 0000000000..7e833f1c7d
--- /dev/null
+++ b/.github/workflows/verify-templating.yml
@@ -0,0 +1,22 @@
+name: Verify Templating
+
+on:
+ pull_request:
+ push:
+
+defaults:
+ run:
+ shell: 'bash -Eeuo pipefail -x {0}'
+
+jobs:
+ apply-templates:
+ name: Check For Uncomitted Changes
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Apply Templates
+ run: ./apply-templates.sh
+ - name: Check Git Status
+ run: |
+ status="$(git status --short)"
+ [ -z "$status" ]
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..d548f66de0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.jq-template.awk
diff --git a/7.2/alpine3.11/cli/Dockerfile b/7.2/alpine3.11/cli/Dockerfile
index 7b2b51a160..970f5bbe45 100644
--- a/7.2/alpine3.11/cli/Dockerfile
+++ b/7.2/alpine3.11/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -177,6 +174,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -186,6 +184,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.2/alpine3.11/fpm/Dockerfile b/7.2/alpine3.11/fpm/Dockerfile
index e2fc9c2ec2..7edb9d4deb 100644
--- a/7.2/alpine3.11/fpm/Dockerfile
+++ b/7.2/alpine3.11/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -178,6 +176,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -187,7 +186,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -232,4 +230,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/7.2/alpine3.11/zts/Dockerfile b/7.2/alpine3.11/zts/Dockerfile
index 93bc039ede..e23b12acc3 100644
--- a/7.2/alpine3.11/zts/Dockerfile
+++ b/7.2/alpine3.11/zts/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -178,6 +176,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -187,6 +186,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.2/alpine3.12/cli/Dockerfile b/7.2/alpine3.12/cli/Dockerfile
index d6bd122557..41488f71d4 100644
--- a/7.2/alpine3.12/cli/Dockerfile
+++ b/7.2/alpine3.12/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -177,6 +174,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -186,6 +184,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.2/alpine3.12/fpm/Dockerfile b/7.2/alpine3.12/fpm/Dockerfile
index 672cb1c993..f90177945b 100644
--- a/7.2/alpine3.12/fpm/Dockerfile
+++ b/7.2/alpine3.12/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -178,6 +176,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -187,7 +186,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -232,4 +230,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/7.2/alpine3.12/zts/Dockerfile b/7.2/alpine3.12/zts/Dockerfile
index 0adcd56d82..cf4cb8e4fd 100644
--- a/7.2/alpine3.12/zts/Dockerfile
+++ b/7.2/alpine3.12/zts/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -178,6 +176,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -187,6 +186,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.2/buster/apache/Dockerfile b/7.2/buster/apache/Dockerfile
index e0b4f31e9e..98638294f5 100644
--- a/7.2/buster/apache/Dockerfile
+++ b/7.2/buster/apache/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,7 +48,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV APACHE_CONFDIR /etc/apache2
ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars
@@ -109,7 +108,6 @@ RUN { \
ENV PHP_EXTRA_BUILD_DEPS apache2-dev
ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -258,6 +256,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -270,7 +269,6 @@ RUN docker-php-ext-enable sodium
RUN { echo '#!/bin/sh'; echo 'exec pkg-config "$@" freetype2'; } > /usr/local/bin/freetype-config && chmod +x /usr/local/bin/freetype-config
ENTRYPOINT ["docker-php-entrypoint"]
-####
# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
STOPSIGNAL SIGWINCH
@@ -279,4 +277,3 @@ WORKDIR /var/www/html
EXPOSE 80
CMD ["apache2-foreground"]
-####
diff --git a/7.2/buster/cli/Dockerfile b/7.2/buster/cli/Dockerfile
index 111bc0f907..879cff1e45 100644
--- a/7.2/buster/cli/Dockerfile
+++ b/7.2/buster/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -198,6 +195,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -210,6 +208,4 @@ RUN docker-php-ext-enable sodium
RUN { echo '#!/bin/sh'; echo 'exec pkg-config "$@" freetype2'; } > /usr/local/bin/freetype-config && chmod +x /usr/local/bin/freetype-config
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.2/buster/fpm/Dockerfile b/7.2/buster/fpm/Dockerfile
index 84c329d709..52b320e1f1 100644
--- a/7.2/buster/fpm/Dockerfile
+++ b/7.2/buster/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -199,6 +197,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -211,7 +210,6 @@ RUN docker-php-ext-enable sodium
RUN { echo '#!/bin/sh'; echo 'exec pkg-config "$@" freetype2'; } > /usr/local/bin/freetype-config && chmod +x /usr/local/bin/freetype-config
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -256,4 +254,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/7.2/buster/zts/Dockerfile b/7.2/buster/zts/Dockerfile
index 5e279867c8..43890937f0 100644
--- a/7.2/buster/zts/Dockerfile
+++ b/7.2/buster/zts/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -199,6 +197,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -211,6 +210,4 @@ RUN docker-php-ext-enable sodium
RUN { echo '#!/bin/sh'; echo 'exec pkg-config "$@" freetype2'; } > /usr/local/bin/freetype-config && chmod +x /usr/local/bin/freetype-config
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.2/stretch/apache/Dockerfile b/7.2/stretch/apache/Dockerfile
index fa7c1e4ffe..32e2518b1d 100644
--- a/7.2/stretch/apache/Dockerfile
+++ b/7.2/stretch/apache/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,7 +48,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV APACHE_CONFDIR /etc/apache2
ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars
@@ -109,7 +108,6 @@ RUN { \
ENV PHP_EXTRA_BUILD_DEPS apache2-dev
ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -166,7 +164,6 @@ COPY docker-php-source /usr/local/bin/
RUN set -eux; \
\
savedAptMark="$(apt-mark showmanual)"; \
-####
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
{ \
echo 'Package: *'; \
@@ -177,7 +174,6 @@ RUN set -eux; \
echo 'Pin: release n=buster*'; \
echo 'Pin-Priority: 990'; \
} > /etc/apt/preferences.d/argon2-buster; \
-####
apt-get update; \
apt-get install -y --no-install-recommends \
libargon2-dev \
@@ -270,6 +266,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -279,7 +276,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
STOPSIGNAL SIGWINCH
@@ -288,4 +284,3 @@ WORKDIR /var/www/html
EXPOSE 80
CMD ["apache2-foreground"]
-####
diff --git a/7.2/stretch/cli/Dockerfile b/7.2/stretch/cli/Dockerfile
index 926e687e15..d1d4d4106b 100644
--- a/7.2/stretch/cli/Dockerfile
+++ b/7.2/stretch/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -106,7 +103,6 @@ COPY docker-php-source /usr/local/bin/
RUN set -eux; \
\
savedAptMark="$(apt-mark showmanual)"; \
-####
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
{ \
echo 'Package: *'; \
@@ -117,7 +113,6 @@ RUN set -eux; \
echo 'Pin: release n=buster*'; \
echo 'Pin-Priority: 990'; \
} > /etc/apt/preferences.d/argon2-buster; \
-####
apt-get update; \
apt-get install -y --no-install-recommends \
libargon2-dev \
@@ -210,6 +205,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -219,6 +215,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.2/stretch/fpm/Dockerfile b/7.2/stretch/fpm/Dockerfile
index c9f211fcae..9832a8a077 100644
--- a/7.2/stretch/fpm/Dockerfile
+++ b/7.2/stretch/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -107,7 +105,6 @@ COPY docker-php-source /usr/local/bin/
RUN set -eux; \
\
savedAptMark="$(apt-mark showmanual)"; \
-####
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
{ \
echo 'Package: *'; \
@@ -118,7 +115,6 @@ RUN set -eux; \
echo 'Pin: release n=buster*'; \
echo 'Pin-Priority: 990'; \
} > /etc/apt/preferences.d/argon2-buster; \
-####
apt-get update; \
apt-get install -y --no-install-recommends \
libargon2-dev \
@@ -211,6 +207,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -220,7 +217,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -265,4 +261,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/7.2/stretch/zts/Dockerfile b/7.2/stretch/zts/Dockerfile
index 1c9e316d9a..a81be82792 100644
--- a/7.2/stretch/zts/Dockerfile
+++ b/7.2/stretch/zts/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -107,7 +105,6 @@ COPY docker-php-source /usr/local/bin/
RUN set -eux; \
\
savedAptMark="$(apt-mark showmanual)"; \
-####
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
{ \
echo 'Package: *'; \
@@ -118,7 +115,6 @@ RUN set -eux; \
echo 'Pin: release n=buster*'; \
echo 'Pin-Priority: 990'; \
} > /etc/apt/preferences.d/argon2-buster; \
-####
apt-get update; \
apt-get install -y --no-install-recommends \
libargon2-dev \
@@ -211,6 +207,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -220,6 +217,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.3/alpine3.11/cli/Dockerfile b/7.3/alpine3.11/cli/Dockerfile
index 459763bac3..1143a55182 100644
--- a/7.3/alpine3.11/cli/Dockerfile
+++ b/7.3/alpine3.11/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -177,6 +174,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -186,6 +184,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.3/alpine3.11/fpm/Dockerfile b/7.3/alpine3.11/fpm/Dockerfile
index 795f72153a..957ead4e74 100644
--- a/7.3/alpine3.11/fpm/Dockerfile
+++ b/7.3/alpine3.11/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -178,6 +176,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -187,7 +186,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -234,4 +232,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/7.3/alpine3.11/zts/Dockerfile b/7.3/alpine3.11/zts/Dockerfile
index b919664a55..3652b40b7e 100644
--- a/7.3/alpine3.11/zts/Dockerfile
+++ b/7.3/alpine3.11/zts/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -178,6 +176,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -187,6 +186,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.3/alpine3.12/cli/Dockerfile b/7.3/alpine3.12/cli/Dockerfile
index d83c716458..3cd1dd7e6b 100644
--- a/7.3/alpine3.12/cli/Dockerfile
+++ b/7.3/alpine3.12/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -177,6 +174,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -186,6 +184,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.3/alpine3.12/fpm/Dockerfile b/7.3/alpine3.12/fpm/Dockerfile
index 0078e7e501..b0a33178b1 100644
--- a/7.3/alpine3.12/fpm/Dockerfile
+++ b/7.3/alpine3.12/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -178,6 +176,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -187,7 +186,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -234,4 +232,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/7.3/alpine3.12/zts/Dockerfile b/7.3/alpine3.12/zts/Dockerfile
index 2c4922ac94..9b37bef589 100644
--- a/7.3/alpine3.12/zts/Dockerfile
+++ b/7.3/alpine3.12/zts/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -178,6 +176,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -187,6 +186,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.3/buster/apache/Dockerfile b/7.3/buster/apache/Dockerfile
index a62e869c83..f49970f59e 100644
--- a/7.3/buster/apache/Dockerfile
+++ b/7.3/buster/apache/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,7 +48,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV APACHE_CONFDIR /etc/apache2
ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars
@@ -109,7 +108,6 @@ RUN { \
ENV PHP_EXTRA_BUILD_DEPS apache2-dev
ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -258,6 +256,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -270,7 +269,6 @@ RUN docker-php-ext-enable sodium
RUN { echo '#!/bin/sh'; echo 'exec pkg-config "$@" freetype2'; } > /usr/local/bin/freetype-config && chmod +x /usr/local/bin/freetype-config
ENTRYPOINT ["docker-php-entrypoint"]
-####
# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
STOPSIGNAL SIGWINCH
@@ -279,4 +277,3 @@ WORKDIR /var/www/html
EXPOSE 80
CMD ["apache2-foreground"]
-####
diff --git a/7.3/buster/cli/Dockerfile b/7.3/buster/cli/Dockerfile
index c636cc48c5..fb4b6d5bec 100644
--- a/7.3/buster/cli/Dockerfile
+++ b/7.3/buster/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -198,6 +195,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -210,6 +208,4 @@ RUN docker-php-ext-enable sodium
RUN { echo '#!/bin/sh'; echo 'exec pkg-config "$@" freetype2'; } > /usr/local/bin/freetype-config && chmod +x /usr/local/bin/freetype-config
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.3/buster/fpm/Dockerfile b/7.3/buster/fpm/Dockerfile
index 501861bedb..91e208bf24 100644
--- a/7.3/buster/fpm/Dockerfile
+++ b/7.3/buster/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -199,6 +197,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -211,7 +210,6 @@ RUN docker-php-ext-enable sodium
RUN { echo '#!/bin/sh'; echo 'exec pkg-config "$@" freetype2'; } > /usr/local/bin/freetype-config && chmod +x /usr/local/bin/freetype-config
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -258,4 +256,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/7.3/buster/zts/Dockerfile b/7.3/buster/zts/Dockerfile
index 2634bb7162..f4f5c33961 100644
--- a/7.3/buster/zts/Dockerfile
+++ b/7.3/buster/zts/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -199,6 +197,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -211,6 +210,4 @@ RUN docker-php-ext-enable sodium
RUN { echo '#!/bin/sh'; echo 'exec pkg-config "$@" freetype2'; } > /usr/local/bin/freetype-config && chmod +x /usr/local/bin/freetype-config
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.3/stretch/apache/Dockerfile b/7.3/stretch/apache/Dockerfile
index e4daf4e2bd..1e19a87b2a 100644
--- a/7.3/stretch/apache/Dockerfile
+++ b/7.3/stretch/apache/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,7 +48,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV APACHE_CONFDIR /etc/apache2
ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars
@@ -109,7 +108,6 @@ RUN { \
ENV PHP_EXTRA_BUILD_DEPS apache2-dev
ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -166,7 +164,6 @@ COPY docker-php-source /usr/local/bin/
RUN set -eux; \
\
savedAptMark="$(apt-mark showmanual)"; \
-####
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
{ \
echo 'Package: *'; \
@@ -177,7 +174,6 @@ RUN set -eux; \
echo 'Pin: release n=buster*'; \
echo 'Pin-Priority: 990'; \
} > /etc/apt/preferences.d/argon2-buster; \
-####
apt-get update; \
apt-get install -y --no-install-recommends \
libargon2-dev \
@@ -270,6 +266,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -279,7 +276,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
STOPSIGNAL SIGWINCH
@@ -288,4 +284,3 @@ WORKDIR /var/www/html
EXPOSE 80
CMD ["apache2-foreground"]
-####
diff --git a/7.3/stretch/cli/Dockerfile b/7.3/stretch/cli/Dockerfile
index 71705ce68a..5437ecc1d3 100644
--- a/7.3/stretch/cli/Dockerfile
+++ b/7.3/stretch/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -106,7 +103,6 @@ COPY docker-php-source /usr/local/bin/
RUN set -eux; \
\
savedAptMark="$(apt-mark showmanual)"; \
-####
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
{ \
echo 'Package: *'; \
@@ -117,7 +113,6 @@ RUN set -eux; \
echo 'Pin: release n=buster*'; \
echo 'Pin-Priority: 990'; \
} > /etc/apt/preferences.d/argon2-buster; \
-####
apt-get update; \
apt-get install -y --no-install-recommends \
libargon2-dev \
@@ -210,6 +205,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -219,6 +215,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.3/stretch/fpm/Dockerfile b/7.3/stretch/fpm/Dockerfile
index ad8f2cdaad..5596e13909 100644
--- a/7.3/stretch/fpm/Dockerfile
+++ b/7.3/stretch/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -107,7 +105,6 @@ COPY docker-php-source /usr/local/bin/
RUN set -eux; \
\
savedAptMark="$(apt-mark showmanual)"; \
-####
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
{ \
echo 'Package: *'; \
@@ -118,7 +115,6 @@ RUN set -eux; \
echo 'Pin: release n=buster*'; \
echo 'Pin-Priority: 990'; \
} > /etc/apt/preferences.d/argon2-buster; \
-####
apt-get update; \
apt-get install -y --no-install-recommends \
libargon2-dev \
@@ -211,6 +207,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -220,7 +217,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -267,4 +263,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/7.3/stretch/zts/Dockerfile b/7.3/stretch/zts/Dockerfile
index 86e1ddbd6e..b98cb1ba35 100644
--- a/7.3/stretch/zts/Dockerfile
+++ b/7.3/stretch/zts/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -107,7 +105,6 @@ COPY docker-php-source /usr/local/bin/
RUN set -eux; \
\
savedAptMark="$(apt-mark showmanual)"; \
-####
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
{ \
echo 'Package: *'; \
@@ -118,7 +115,6 @@ RUN set -eux; \
echo 'Pin: release n=buster*'; \
echo 'Pin-Priority: 990'; \
} > /etc/apt/preferences.d/argon2-buster; \
-####
apt-get update; \
apt-get install -y --no-install-recommends \
libargon2-dev \
@@ -211,6 +207,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -220,6 +217,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.4/alpine3.11/cli/Dockerfile b/7.4/alpine3.11/cli/Dockerfile
index 71ec897de8..dff11aa39c 100644
--- a/7.4/alpine3.11/cli/Dockerfile
+++ b/7.4/alpine3.11/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -148,7 +145,8 @@ RUN set -eux; \
--with-openssl \
--with-zlib \
\
-# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
+# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
+# ... and are removed in PHP 8+; see also https://github.com/docker-library/php/pull/847#issuecomment-505638229
--with-pear \
\
# bundled pcre does not support JIT on s390x
@@ -182,6 +180,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -191,6 +190,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.4/alpine3.11/fpm/Dockerfile b/7.4/alpine3.11/fpm/Dockerfile
index 6668b5eda4..7cb5aa781c 100644
--- a/7.4/alpine3.11/fpm/Dockerfile
+++ b/7.4/alpine3.11/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -149,7 +147,8 @@ RUN set -eux; \
--with-openssl \
--with-zlib \
\
-# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
+# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
+# ... and are removed in PHP 8+; see also https://github.com/docker-library/php/pull/847#issuecomment-505638229
--with-pear \
\
# bundled pcre does not support JIT on s390x
@@ -183,6 +182,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -192,7 +192,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -239,4 +238,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/7.4/alpine3.11/zts/Dockerfile b/7.4/alpine3.11/zts/Dockerfile
index d1429e82bc..4149f1362c 100644
--- a/7.4/alpine3.11/zts/Dockerfile
+++ b/7.4/alpine3.11/zts/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -149,7 +147,8 @@ RUN set -eux; \
--with-openssl \
--with-zlib \
\
-# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
+# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
+# ... and are removed in PHP 8+; see also https://github.com/docker-library/php/pull/847#issuecomment-505638229
--with-pear \
\
# bundled pcre does not support JIT on s390x
@@ -183,6 +182,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -192,6 +192,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.4/alpine3.12/cli/Dockerfile b/7.4/alpine3.12/cli/Dockerfile
index 84bf7f68b9..a0ddefd657 100644
--- a/7.4/alpine3.12/cli/Dockerfile
+++ b/7.4/alpine3.12/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -148,7 +145,8 @@ RUN set -eux; \
--with-openssl \
--with-zlib \
\
-# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
+# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
+# ... and are removed in PHP 8+; see also https://github.com/docker-library/php/pull/847#issuecomment-505638229
--with-pear \
\
# bundled pcre does not support JIT on s390x
@@ -182,6 +180,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -191,6 +190,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.4/alpine3.12/fpm/Dockerfile b/7.4/alpine3.12/fpm/Dockerfile
index 8edb5efc0e..09ba509853 100644
--- a/7.4/alpine3.12/fpm/Dockerfile
+++ b/7.4/alpine3.12/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -149,7 +147,8 @@ RUN set -eux; \
--with-openssl \
--with-zlib \
\
-# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
+# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
+# ... and are removed in PHP 8+; see also https://github.com/docker-library/php/pull/847#issuecomment-505638229
--with-pear \
\
# bundled pcre does not support JIT on s390x
@@ -183,6 +182,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -192,7 +192,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -239,4 +238,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/7.4/alpine3.12/zts/Dockerfile b/7.4/alpine3.12/zts/Dockerfile
index 46ca8291ad..dd9e21f250 100644
--- a/7.4/alpine3.12/zts/Dockerfile
+++ b/7.4/alpine3.12/zts/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -149,7 +147,8 @@ RUN set -eux; \
--with-openssl \
--with-zlib \
\
-# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
+# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
+# ... and are removed in PHP 8+; see also https://github.com/docker-library/php/pull/847#issuecomment-505638229
--with-pear \
\
# bundled pcre does not support JIT on s390x
@@ -183,6 +182,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -192,6 +192,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.4/buster/apache/Dockerfile b/7.4/buster/apache/Dockerfile
index 04cb18e7ad..f733d5354c 100644
--- a/7.4/buster/apache/Dockerfile
+++ b/7.4/buster/apache/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,7 +48,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV APACHE_CONFDIR /etc/apache2
ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars
@@ -109,7 +108,6 @@ RUN { \
ENV PHP_EXTRA_BUILD_DEPS apache2-dev
ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -224,7 +222,8 @@ RUN set -eux; \
--with-openssl \
--with-zlib \
\
-# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
+# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
+# ... and are removed in PHP 8+; see also https://github.com/docker-library/php/pull/847#issuecomment-505638229
--with-pear \
\
# bundled pcre does not support JIT on s390x
@@ -262,6 +261,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -271,7 +271,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
STOPSIGNAL SIGWINCH
@@ -280,4 +279,3 @@ WORKDIR /var/www/html
EXPOSE 80
CMD ["apache2-foreground"]
-####
diff --git a/7.4/buster/cli/Dockerfile b/7.4/buster/cli/Dockerfile
index e8aa36b70f..bc1bbdb355 100644
--- a/7.4/buster/cli/Dockerfile
+++ b/7.4/buster/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -164,7 +161,8 @@ RUN set -eux; \
--with-openssl \
--with-zlib \
\
-# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
+# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
+# ... and are removed in PHP 8+; see also https://github.com/docker-library/php/pull/847#issuecomment-505638229
--with-pear \
\
# bundled pcre does not support JIT on s390x
@@ -202,6 +200,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -211,6 +210,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/7.4/buster/fpm/Dockerfile b/7.4/buster/fpm/Dockerfile
index af5108a84f..ba9ac12ca9 100644
--- a/7.4/buster/fpm/Dockerfile
+++ b/7.4/buster/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -165,7 +163,8 @@ RUN set -eux; \
--with-openssl \
--with-zlib \
\
-# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
+# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
+# ... and are removed in PHP 8+; see also https://github.com/docker-library/php/pull/847#issuecomment-505638229
--with-pear \
\
# bundled pcre does not support JIT on s390x
@@ -203,6 +202,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -212,7 +212,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -259,4 +258,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/7.4/buster/zts/Dockerfile b/7.4/buster/zts/Dockerfile
index 6d0e505806..c4c3c1aaee 100644
--- a/7.4/buster/zts/Dockerfile
+++ b/7.4/buster/zts/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -165,7 +163,8 @@ RUN set -eux; \
--with-openssl \
--with-zlib \
\
-# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
+# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
+# ... and are removed in PHP 8+; see also https://github.com/docker-library/php/pull/847#issuecomment-505638229
--with-pear \
\
# bundled pcre does not support JIT on s390x
@@ -203,6 +202,7 @@ RUN set -eux; \
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
# smoke test
php --version
@@ -212,6 +212,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/8.0-rc/alpine3.12/cli/Dockerfile b/8.0-rc/alpine3.12/cli/Dockerfile
index 82876a945c..d111a4cad6 100644
--- a/8.0-rc/alpine3.12/cli/Dockerfile
+++ b/8.0-rc/alpine3.12/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -185,6 +182,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/8.0-rc/alpine3.12/fpm/Dockerfile b/8.0-rc/alpine3.12/fpm/Dockerfile
index e5c3e97dc7..77dbe7c694 100644
--- a/8.0-rc/alpine3.12/fpm/Dockerfile
+++ b/8.0-rc/alpine3.12/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -46,9 +46,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -186,7 +184,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -233,4 +230,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/8.0-rc/buster/apache/Dockerfile b/8.0-rc/buster/apache/Dockerfile
index be77944362..682c73b429 100644
--- a/8.0-rc/buster/apache/Dockerfile
+++ b/8.0-rc/buster/apache/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,7 +48,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV APACHE_CONFDIR /etc/apache2
ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars
@@ -109,7 +108,6 @@ RUN { \
ENV PHP_EXTRA_BUILD_DEPS apache2-dev
ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -265,7 +263,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
STOPSIGNAL SIGWINCH
@@ -274,4 +271,3 @@ WORKDIR /var/www/html
EXPOSE 80
CMD ["apache2-foreground"]
-####
diff --git a/8.0-rc/buster/cli/Dockerfile b/8.0-rc/buster/cli/Dockerfile
index 34e3eb23fa..7801a2551c 100644
--- a/8.0-rc/buster/cli/Dockerfile
+++ b/8.0-rc/buster/cli/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,6 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
-####
-
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -205,6 +202,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/8.0-rc/buster/fpm/Dockerfile b/8.0-rc/buster/fpm/Dockerfile
index 405e4f0bbf..b65eb19c44 100644
--- a/8.0-rc/buster/fpm/Dockerfile
+++ b/8.0-rc/buster/fpm/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -206,7 +204,6 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
WORKDIR /var/www/html
RUN set -eux; \
@@ -253,4 +250,3 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
-####
diff --git a/8.0-rc/buster/zts/Dockerfile b/8.0-rc/buster/zts/Dockerfile
index 8a58be5ce1..840babebed 100644
--- a/8.0-rc/buster/zts/Dockerfile
+++ b/8.0-rc/buster/zts/Dockerfile
@@ -1,5 +1,5 @@
#
-# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
@@ -48,9 +48,7 @@ RUN set -eux; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-####
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-zts --disable-cgi
-####
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
@@ -206,6 +204,4 @@ COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
RUN docker-php-ext-enable sodium
ENTRYPOINT ["docker-php-entrypoint"]
-####
CMD ["php", "-a"]
-####
diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template
index 3907efdab0..10d114b08d 100644
--- a/Dockerfile-alpine.template
+++ b/Dockerfile-alpine.template
@@ -1,4 +1,5 @@
-FROM alpine:%%ALPINE_VERSION%%
+{{ include "version-id" -}}
+FROM {{ env.from }}
# dependencies required for running "phpize"
# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed)
@@ -39,10 +40,11 @@ RUN set -eux; \
mkdir -p /var/www/html; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-
-####
-####
-
+{{
+ if env.variantBlock1 != "" then
+ "\n" + env.variantBlock1 + "\n"
+ else "" end
+}}
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -53,11 +55,11 @@ ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_
ENV PHP_CPPFLAGS="$PHP_CFLAGS"
ENV PHP_LDFLAGS="-Wl,-O1 -pie"
-ENV GPG_KEYS %%GPG_KEYS%%
+ENV GPG_KEYS {{ .gpgKeys }}
-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%%"
+ENV PHP_VERSION {{ .version }}
+ENV PHP_URL="{{ .url }}" PHP_ASC_URL="{{ .ascUrl // "" }}"
+ENV PHP_SHA256="{{ .sha256 // "" }}" PHP_MD5="{{ .md5 // "" }}"
RUN set -eux; \
\
@@ -97,10 +99,19 @@ RUN set -eux; \
coreutils \
curl-dev \
libedit-dev \
+{{ if (.version | version_id) >= ("7.2" | version_id) then ( -}}
libsodium-dev \
+{{ ) else "" end -}}
libxml2-dev \
+{{
+ # https://github.com/docker-library/php/issues/888
+ if (.version | version_id) >= ("7.4" | version_id) then (
+-}}
linux-headers \
+{{ ) else "" end -}}
+{{ if (.version | version_id) >= ("7.4" | version_id) then ( -}}
oniguruma-dev \
+{{ ) else "" end -}}
openssl-dev \
sqlite-dev \
; \
@@ -131,8 +142,10 @@ RUN set -eux; \
--enable-mysqlnd \
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
--with-password-argon2 \
+{{ if (.version | version_id) >= ("7.2" | version_id) then ( -}}
# https://wiki.php.net/rfc/libsodium
--with-sodium=shared \
+{{ ) else "" end -}}
# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109)
--with-pdo-sqlite=/usr \
--with-sqlite3=/usr \
@@ -142,9 +155,12 @@ RUN set -eux; \
--with-openssl \
--with-zlib \
\
-# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
+{{ if (.version | version_id) | . >= ("7.4" | version_id) and . < ("8" | version_id) then ( -}}
+# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
+# ... and are removed in PHP 8+; see also https://github.com/docker-library/php/pull/847#issuecomment-505638229
--with-pear \
\
+{{ ) else "" end -}}
# bundled pcre does not support JIT on s390x
# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT
$(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \
@@ -173,18 +189,26 @@ RUN set -eux; \
\
apk del --no-network .build-deps; \
\
+{{ if (.version | version_id) < ("8" | version_id) then ( -}}
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
+{{ ) else "" end -}}
# smoke test
php --version
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
+{{ if (.version | version_id) >= ("7.2" | version_id) then ( -}}
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
RUN docker-php-ext-enable sodium
+{{ ) else "" end -}}
ENTRYPOINT ["docker-php-entrypoint"]
-####
-CMD ["php", "-a"]
-####
+{{
+ if env.variantBlock2 != "" then
+ env.variantBlock2 + "\n"
+ else "" end
+ + "CMD " + env.cmd
+}}
diff --git a/apache-Dockerfile-block-1 b/Dockerfile-apache-block-1.template
similarity index 100%
rename from apache-Dockerfile-block-1
rename to Dockerfile-apache-block-1.template
diff --git a/apache-Dockerfile-block-2 b/Dockerfile-apache-block-2.template
similarity index 85%
rename from apache-Dockerfile-block-2
rename to Dockerfile-apache-block-2.template
index 1732693e17..eb835861f9 100644
--- a/apache-Dockerfile-block-2
+++ b/Dockerfile-apache-block-2.template
@@ -5,4 +5,3 @@ COPY apache2-foreground /usr/local/bin/
WORKDIR /var/www/html
EXPOSE 80
-CMD ["apache2-foreground"]
diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template
index cfaeb9df76..c81c90b775 100644
--- a/Dockerfile-debian.template
+++ b/Dockerfile-debian.template
@@ -1,4 +1,5 @@
-FROM debian:%%DEBIAN_TAG%%
+{{ include "version-id" -}}
+FROM {{ env.from }}
# prevent Debian's PHP packages from being installed
# https://github.com/docker-library/php/pull/542
@@ -41,10 +42,11 @@ RUN set -eux; \
mkdir -p /var/www/html; \
chown www-data:www-data /var/www/html; \
chmod 777 /var/www/html
-
-####
-####
-
+{{
+ if env.variantBlock1 != "" then
+ "\n" + env.variantBlock1 + "\n"
+ else "" end
+}}
# Apply stack smash protection to functions using local buffers and alloca()
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
# Enable optimization (-O2)
@@ -55,11 +57,11 @@ ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_
ENV PHP_CPPFLAGS="$PHP_CFLAGS"
ENV PHP_LDFLAGS="-Wl,-O1 -pie"
-ENV GPG_KEYS %%GPG_KEYS%%
+ENV GPG_KEYS {{ .gpgKeys }}
-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%%"
+ENV PHP_VERSION {{ .version }}
+ENV PHP_URL="{{ .url }}" PHP_ASC_URL="{{ .ascUrl // "" }}"
+ENV PHP_SHA256="{{ .sha256 // "" }}" PHP_MD5="{{ .md5 // "" }}"
RUN set -eux; \
\
@@ -100,7 +102,10 @@ COPY docker-php-source /usr/local/bin/
RUN set -eux; \
\
savedAptMark="$(apt-mark showmanual)"; \
-####
+{{
+ # stretch needs to pull argon2 from buster
+ if env.suite == "stretch" then (
+-}}
sed -e 's/stretch/buster/g' /etc/apt/sources.list > /etc/apt/sources.list.d/buster.list; \
{ \
echo 'Package: *'; \
@@ -111,14 +116,21 @@ RUN set -eux; \
echo 'Pin: release n=buster*'; \
echo 'Pin-Priority: 990'; \
} > /etc/apt/preferences.d/argon2-buster; \
-####
+{{ ) else "" end -}}
apt-get update; \
apt-get install -y --no-install-recommends \
libargon2-dev \
libcurl4-openssl-dev \
libedit-dev \
+{{
+ # oniguruma is part of mbstring in php 7.4+
+ if (.version | version_id) >= ("7.4" | version_id) then (
+-}}
libonig-dev \
+{{ ) else "" end -}}
+{{ if (.version | version_id) >= ("7.2" | version_id) then ( -}}
libsodium-dev \
+{{ ) else "" end -}}
libsqlite3-dev \
libssl-dev \
libxml2-dev \
@@ -159,8 +171,10 @@ RUN set -eux; \
--enable-mysqlnd \
# https://wiki.php.net/rfc/argon2_password_hash (7.2+)
--with-password-argon2 \
+{{ if (.version | version_id) >= ("7.2" | version_id) then ( -}}
# https://wiki.php.net/rfc/libsodium
--with-sodium=shared \
+{{ ) else "" end -}}
# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109)
--with-pdo-sqlite=/usr \
--with-sqlite3=/usr \
@@ -170,9 +184,12 @@ RUN set -eux; \
--with-openssl \
--with-zlib \
\
-# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494
+{{ if (.version | version_id) | . >= ("7.4" | version_id) and . < ("8" | version_id) then ( -}}
+# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
+# ... and are removed in PHP 8+; see also https://github.com/docker-library/php/pull/847#issuecomment-505638229
--with-pear \
\
+{{ ) else "" end -}}
# bundled pcre does not support JIT on s390x
# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT
$(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \
@@ -205,21 +222,37 @@ RUN set -eux; \
; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
\
+{{ if (.version | version_id) < ("8" | version_id) then ( -}}
# update pecl channel definitions https://github.com/docker-library/php/issues/443
pecl update-channels; \
rm -rf /tmp/pear ~/.pearrc; \
+ \
+{{ ) else "" end -}}
# smoke test
php --version
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
+{{ if (.version | version_id) >= ("7.2" | version_id) then ( -}}
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
RUN docker-php-ext-enable sodium
+{{ ) else "" end -}}
+{{
+ # https://github.com/docker-library/php/issues/865
+ # https://bugs.php.net/bug.php?id=76324
+ # https://github.com/php/php-src/pull/3632
+ # https://github.com/php/php-src/commit/2d03197749696ac3f8effba6b7977b0d8729fef3
+ if env.suite != "stretch" and (.version | version_id) < ("7.4" | version_id) then (
+-}}
# temporary "freetype-config" workaround for https://github.com/docker-library/php/issues/865 (https://bugs.php.net/bug.php?id=76324)
RUN { echo '#!/bin/sh'; echo 'exec pkg-config "$@" freetype2'; } > /usr/local/bin/freetype-config && chmod +x /usr/local/bin/freetype-config
+{{ ) else "" end -}}
ENTRYPOINT ["docker-php-entrypoint"]
-####
-CMD ["php", "-a"]
-####
+{{
+ if env.variantBlock2 != "" then
+ env.variantBlock2 + "\n"
+ else "" end
+ + "CMD " + env.cmd
+}}
diff --git a/fpm-Dockerfile-block-1 b/Dockerfile-fpm-block-1.template
similarity index 100%
rename from fpm-Dockerfile-block-1
rename to Dockerfile-fpm-block-1.template
diff --git a/fpm-Dockerfile-block-2 b/Dockerfile-fpm-block-2.template
similarity index 88%
rename from fpm-Dockerfile-block-2
rename to Dockerfile-fpm-block-2.template
index c0c143130c..2e9c285006 100644
--- a/fpm-Dockerfile-block-2
+++ b/Dockerfile-fpm-block-2.template
@@ -1,3 +1,4 @@
+{{ include "version-id" -}}
WORKDIR /var/www/html
RUN set -eux; \
@@ -18,7 +19,9 @@ RUN set -eux; \
{ \
echo '[global]'; \
echo 'error_log = /proc/self/fd/2'; \
+{{ if (.version | version_id) >= ("7.3" | version_id) then ( -}}
echo; echo '; https://github.com/docker-library/php/pull/725#issuecomment-443540114'; echo 'log_limit = 8192'; \
+{{ ) else "" end -}}
echo; \
echo '[www]'; \
echo '; if we send this to /proc/self/fd/1, it never appears'; \
@@ -28,7 +31,9 @@ RUN set -eux; \
echo; \
echo '; Ensure worker stdout and stderr are sent to the main error log.'; \
echo 'catch_workers_output = yes'; \
+{{ if (.version | version_id) >= ("7.3" | version_id) then ( -}}
echo 'decorate_workers_output = no'; \
+{{ ) else "" end -}}
} | tee php-fpm.d/docker.conf; \
{ \
echo '[global]'; \
@@ -43,4 +48,3 @@ RUN set -eux; \
STOPSIGNAL SIGQUIT
EXPOSE 9000
-CMD ["php-fpm"]
diff --git a/Dockerfile-zts-block-1.template b/Dockerfile-zts-block-1.template
new file mode 100644
index 0000000000..d1da1461ec
--- /dev/null
+++ b/Dockerfile-zts-block-1.template
@@ -0,0 +1,8 @@
+{{ include "version-id" -}}
+ENV PHP_EXTRA_CONFIGURE_ARGS {{
+ if (.version | version_id) >= ("8" | version_id) then
+ "--enable-zts"
+ else
+ "--enable-maintainer-zts"
+ end
+}} --disable-cgi
diff --git a/apply-templates.sh b/apply-templates.sh
new file mode 100755
index 0000000000..861f083aeb
--- /dev/null
+++ b/apply-templates.sh
@@ -0,0 +1,82 @@
+#!/usr/bin/env bash
+set -Eeuo pipefail
+
+[ -f versions.json ] # run "versions.sh" first
+
+jqt='.jq-template.awk'
+if [ -n "${BASHBREW_SCRIPTS:-}" ]; then
+ jqt="$BASHBREW_SCRIPTS/jq-template.awk"
+elif [ "$BASH_SOURCE" -nt "$jqt" ]; then
+ wget -qO "$jqt" 'https://github.com/docker-library/bashbrew/raw/5f0c26381fb7cc78b2d217d58007800bdcfbcfa1/scripts/jq-template.awk'
+fi
+
+if [ "$#" -eq 0 ]; then
+ versions="$(jq -r 'keys | map(@sh) | join(" ")' versions.json)"
+ eval "set -- $versions"
+fi
+
+generated_warning() {
+ cat <<-EOH
+ #
+ # NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
+ #
+ # PLEASE DO NOT EDIT IT DIRECTLY.
+ #
+
+ EOH
+}
+
+for version; do
+ export version
+
+ variants="$(jq -r '.[env.version].variants | map(@sh) | join(" ")' versions.json)"
+ eval "variants=( $variants )"
+
+ for dir in "${variants[@]}"; do
+ suite="$(dirname "$dir")" # "buster", etc
+ variant="$(basename "$dir")" # "cli", etc
+ export suite variant
+
+ alpineVer="${suite#alpine}" # "3.12", etc
+ if [ "$suite" != "$alpineVer" ]; then
+ template='Dockerfile-alpine.template'
+ from="alpine:$alpineVer"
+ else
+ template='Dockerfile-debian.template'
+ from="debian:$suite-slim"
+ fi
+ export from
+
+ case "$variant" in
+ apache) cmd='["apache2-foreground"]' ;;
+ fpm) cmd='["php-fpm"]' ;;
+ *) cmd='["php", "-a"]' ;;
+ esac
+ export cmd
+
+ echo "processing $version/$dir ..."
+
+ variantBlock1="$(if [ -f "Dockerfile-$variant-block-1.template" ]; then gawk -f "$jqt" "Dockerfile-$variant-block-1.template"; fi)"
+ variantBlock2="$(if [ -f "Dockerfile-$variant-block-2.template" ]; then gawk -f "$jqt" "Dockerfile-$variant-block-2.template"; fi)"
+ export variantBlock1 variantBlock2
+
+ {
+ generated_warning
+ gawk -f "$jqt" "$template"
+ } > "$version/$dir/Dockerfile"
+
+ cp -a \
+ docker-php-entrypoint \
+ docker-php-ext-* \
+ docker-php-source \
+ "$version/$dir/"
+ if [ "$variant" = 'apache' ]; then
+ cp -a apache2-foreground "$version/$dir/"
+ fi
+
+ cmd="$(jq <<<"$cmd" -r '.[0]')"
+ if [ "$cmd" != 'php' ]; then
+ sed -i -e 's! php ! '"$cmd"' !g' "$version/$dir/docker-php-entrypoint"
+ fi
+ done
+done
diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh
index fff991d096..71df4cd9ad 100755
--- a/generate-stackbrew-library.sh
+++ b/generate-stackbrew-library.sh
@@ -20,11 +20,13 @@ declare -A alpineVersions=(
self="$(basename "$BASH_SOURCE")"
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
-versions=( */ )
-versions=( "${versions[@]%/}" )
+if [ "$#" -eq 0 ]; then
+ versions="$(jq -r 'keys | map(@sh) | join(" ")' versions.json)"
+ eval "set -- $versions"
+fi
# sort version numbers with highest first
-IFS=$'\n'; versions=( $(echo "${versions[*]}" | sort -rV) ); unset IFS
+IFS=$'\n'; set -- $(sort -rV <<<"$*"); unset IFS
# get the most recent commit which modified any of "$@"
fileCommit() {
@@ -79,68 +81,63 @@ join() {
echo "${out#$sep}"
}
-for version in "${versions[@]}"; do
+for version; do
+ export version
+ variants="$(jq -r '.[env.version].variants | map(@sh) | join(" ")' versions.json)"
+ eval "variants=( $variants )"
versionAliases=(
$version
${aliases[$version]:-}
)
- # order here controls the order of the library/ file
- for suite in \
- buster stretch \
- alpine{3.12,3.11} \
- ; do
- for variant in \
- cli \
- apache \
- fpm \
- zts \
- ; do
- dir="$version/$suite/$variant"
- [ -f "$dir/Dockerfile" ] || continue
-
- commit="$(dirCommit "$dir")"
- fullVersion="$(git show "$commit":"$dir/Dockerfile" | awk '$1 == "ENV" && $2 == "PHP_VERSION" { print $3; exit }')"
-
- baseAliases=( $fullVersion "${versionAliases[@]}" )
- variantAliases=( "${baseAliases[@]/%/-$variant}" )
- variantAliases=( "${variantAliases[@]//latest-/}" )
-
- if [ "$variant" = 'cli' ]; then
- variantAliases+=( "${baseAliases[@]}" )
- fi
-
- suiteVariantAliases=( "${variantAliases[@]/%/-$suite}" )
- if [ "${suite#alpine}" = "${alpineVersions[$version]:-$defaultAlpineVersion}" ] ; then
- variantAliases=( "${variantAliases[@]/%/-alpine}" )
- elif [ "$suite" != "${debianSuites[$version]:-$defaultDebianSuite}" ]; then
- variantAliases=()
- fi
- variantAliases=( "${suiteVariantAliases[@]}" ${variantAliases[@]+"${variantAliases[@]}"} )
- variantAliases=( "${variantAliases[@]//latest-/}" )
-
- variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$dir/Dockerfile")"
- variantArches="${parentRepoToArches[$variantParent]}"
-
- if [ "$version" = '7.2' ]; then
- # PHP 7.2 doesn't compile on MIPS:
- # /usr/src/php/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c:506:3: error: a label can only be part of a statement and a declaration is not a statement
- # sljit_sw fir;
- # ^~~~~~~~
- # According to https://github.com/openwrt/packages/issues/5333 + https://github.com/openwrt/packages/pull/5335,
- # https://github.com/svn2github/pcre/commit/e5045fd31a2e171dff305665e2b921d7c93427b8#diff-291428aa92cf90de0f2486f9c2829158
- # *might* fix it, but it's likely not worth it just for PHP 7.2 on MIPS (since 7.3 and 7.4 work fine).
- variantArches="$(echo " $variantArches " | sed -e 's/ mips64le / /g')"
- fi
-
- echo
- cat <<-EOE
- Tags: $(join ', ' "${variantAliases[@]}")
- Architectures: $(join ', ' $variantArches)
- GitCommit: $commit
- Directory: $dir
- EOE
- done
+ for dir in "${variants[@]}"; do
+ suite="$(dirname "$dir")" # "buster", etc
+ variant="$(basename "$dir")" # "cli", etc
+ dir="$version/$dir"
+ [ -f "$dir/Dockerfile" ] || continue
+
+ fullVersion="$(jq -r '.[env.version].version' versions.json)"
+
+ baseAliases=( $fullVersion "${versionAliases[@]}" )
+ variantAliases=( "${baseAliases[@]/%/-$variant}" )
+ variantAliases=( "${variantAliases[@]//latest-/}" )
+
+ if [ "$variant" = 'cli' ]; then
+ variantAliases+=( "${baseAliases[@]}" )
+ fi
+
+ suiteVariantAliases=( "${variantAliases[@]/%/-$suite}" )
+ if [ "${suite#alpine}" = "${alpineVersions[$version]:-$defaultAlpineVersion}" ] ; then
+ variantAliases=( "${variantAliases[@]/%/-alpine}" )
+ elif [ "$suite" != "${debianSuites[$version]:-$defaultDebianSuite}" ]; then
+ variantAliases=()
+ fi
+ variantAliases=( "${suiteVariantAliases[@]}" ${variantAliases[@]+"${variantAliases[@]}"} )
+ variantAliases=( "${variantAliases[@]//latest-/}" )
+
+ variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$dir/Dockerfile")"
+ variantArches="${parentRepoToArches[$variantParent]}"
+
+ if [ "$version" = '7.2' ]; then
+ # PHP 7.2 doesn't compile on MIPS:
+ # /usr/src/php/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c:506:3: error: a label can only be part of a statement and a declaration is not a statement
+ # sljit_sw fir;
+ # ^~~~~~~~
+ # According to https://github.com/openwrt/packages/issues/5333 + https://github.com/openwrt/packages/pull/5335,
+ # https://github.com/svn2github/pcre/commit/e5045fd31a2e171dff305665e2b921d7c93427b8#diff-291428aa92cf90de0f2486f9c2829158
+ # *might* fix it, but it's likely not worth it just for PHP 7.2 on MIPS (since 7.3 and 7.4 work fine).
+ variantArches="$(echo " $variantArches " | sed -e 's/ mips64le / /g')"
+ fi
+
+ commit="$(dirCommit "$dir")"
+
+ echo
+ cat <<-EOE
+ Tags: $(join ', ' "${variantAliases[@]}")
+ Architectures: $(join ', ' $variantArches)
+ GitCommit: $commit
+ Directory: $dir
+ EOE
done
done
diff --git a/update.sh b/update.sh
index a62ae6fd48..bac2d7581c 100755
--- a/update.sh
+++ b/update.sh
@@ -1,260 +1,7 @@
#!/usr/bin/env bash
set -Eeuo pipefail
-# https://www.php.net/gpg-keys.php
-declare -A gpgKeys=(
- # https://wiki.php.net/todo/php80
- # pollita & carusogabriel
- # https://www.php.net/gpg-keys.php#gpg-8.0
- [8.0]='1729F83938DA44E27BA0F4D3DBDB397470D12172 BFDDD28642824F8118EF77909B67A5C12229118F'
-
- # https://wiki.php.net/todo/php74
- # petk & derick
- # https://www.php.net/gpg-keys.php#gpg-7.4
- [7.4]='42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312'
-
- # https://wiki.php.net/todo/php73
- # cmb & stas
- # https://www.php.net/gpg-keys.php#gpg-7.3
- [7.3]='CBAF69F173A0FEA4B537F470D66C9593118BCCB6 F38252826ACD957EF380D39F2F7956BC5DA04B5D'
-
- # https://wiki.php.net/todo/php72
- # pollita & remi
- # https://www.php.net/downloads.php#gpg-7.2
- # https://www.php.net/gpg-keys.php#gpg-7.2
- [7.2]='1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F'
-)
-# see https://www.php.net/downloads.php
-
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
-versions=( "$@" )
-if [ ${#versions[@]} -eq 0 ]; then
- versions=( */ )
-fi
-versions=( "${versions[@]%/}" )
-
-generated_warning() {
- cat <<-EOH
- #
- # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
- #
- # PLEASE DO NOT EDIT IT DIRECTLY.
- #
-
- EOH
-}
-
-for version in "${versions[@]}"; do
- rcVersion="${version%-rc}"
-
- # "7", "5", etc
- majorVersion="${rcVersion%%.*}"
- # "2", "1", "6", etc
- minorVersion="${rcVersion#$majorVersion.}"
- minorVersion="${minorVersion%%.*}"
-
- # scrape the relevant API based on whether we're looking for pre-releases
- apiUrl="https://www.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://www.php.net/distributions/" + .filename,
- "https://www.php.net/distributions/" + .filename + ".asc",
- .sha256 // "",
- .md5 // ""
- ) ]
- '
- if [ "$rcVersion" != "$version" ]; then
- apiUrl='https://qa.php.net/api.php?type=qa-releases&format=json'
- apiJqExpr='
- .releases[]
- | select(.version | startswith("'"$rcVersion"'."))
- | [
- .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 "error: unable to determine available releases of $version"
- echo >&2
- exit 1
- fi
-
- # 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://www.php.net/downloads.php#gpg-$version"
- exit 1
- fi
-
- # if we don't have a .asc URL, let's see if we can figure one out :)
- if [ -z "$ascUrl" ] && wget -q --spider "$url.asc"; then
- ascUrl="$url.asc"
- fi
-
- dockerfiles=()
-
- for suite in buster stretch alpine{3.12,3.11}; do
- [ -d "$version/$suite" ] || continue
- alpineVer="${suite#alpine}"
-
- baseDockerfile=Dockerfile-debian.template
- if [ "${suite#alpine}" != "$suite" ]; then
- baseDockerfile=Dockerfile-alpine.template
- fi
-
- for variant in cli apache fpm zts; do
- [ -d "$version/$suite/$variant" ] || continue
- { generated_warning; cat "$baseDockerfile"; } > "$version/$suite/$variant/Dockerfile"
-
- echo "Generating $version/$suite/$variant/Dockerfile from $baseDockerfile + $variant-Dockerfile-block-*"
- gawk -i inplace -v variant="$variant" '
- $1 == "####" { ia = 0 }
- !ia { print }
- $1 == "####" { ia = 1; ab++; ac = 0; if (system("test -f " variant "-Dockerfile-block-" ab) != 0) { ia = 0 } }
- ia { ac++ }
- ia && ac == 1 { system("cat " variant "-Dockerfile-block-" ab) }
- ' "$version/$suite/$variant/Dockerfile"
-
- cp -a \
- docker-php-entrypoint \
- docker-php-ext-* \
- docker-php-source \
- "$version/$suite/$variant/"
- if [ "$variant" = 'apache' ]; then
- cp -a apache2-foreground "$version/$suite/$variant/"
- fi
- if [ "$majorVersion" = '7' -a "$minorVersion" -lt '2' ]; then
- # argon2 password hashing is only supported in 7.2+
- sed -ri \
- -e '/####/,/##<\/argon2-stretch>##/d' \
- -e '/argon2/d' \
- "$version/$suite/$variant/Dockerfile"
- elif [ "$suite" != 'stretch' ]; then
- # and buster+ doesn't need to pull argon2 from stretch-backports
- sed -ri \
- -e '/####/,/##<\/argon2-stretch>##/d' \
- "$version/$suite/$variant/Dockerfile"
- fi
- if [ "$majorVersion" = '7' -a "$minorVersion" -lt '4' ]; then
- # oniguruma is part of mbstring in php 7.4+
- sed -ri \
- -e '/oniguruma-dev|libonig-dev/d' \
- "$version/$suite/$variant/Dockerfile"
- fi
- if [ "$majorVersion" -ge '8' ]; then
- # 8 and above no longer include pecl/pear (see https://github.com/docker-library/php/issues/846#issuecomment-505638494)
- sed -ri \
- -e '/pear |pearrc|pecl.*channel/d' \
- "$version/$suite/$variant/Dockerfile"
- fi
- if [ "$majorVersion" != '7' ] || [ "$minorVersion" -lt '4' ]; then
- # --with-pear is only relevant on PHP 7, and specifically only 7.4+ (see https://github.com/docker-library/php/issues/846#issuecomment-505638494)
- sed -ri \
- -e '/--with-pear/d' \
- "$version/$suite/$variant/Dockerfile"
- fi
- if [ "$majorVersion" = '7' -a "$minorVersion" -lt '2' ]; then
- # sodium is part of php core 7.2+ https://wiki.php.net/rfc/libsodium
- sed -ri '/sodium/d' "$version/$suite/$variant/Dockerfile"
- fi
- if [ "$variant" = 'fpm' -a "$majorVersion" = '7' -a "$minorVersion" -lt '3' ]; then
- # php-fpm "decorate_workers_output" is only available in 7.3+
- sed -ri \
- -e '/decorate_workers_output/d' \
- -e '/log_limit/d' \
- "$version/$suite/$variant/Dockerfile"
- fi
- if [ "$suite" = 'stretch' ] || [ "$majorVersion" -gt '7' ] || { [ "$majorVersion" = '7' ] && [ "$minorVersion" -ge '4' ]; }; then
- # https://github.com/docker-library/php/issues/865
- # https://bugs.php.net/bug.php?id=76324
- # https://github.com/php/php-src/pull/3632
- # https://github.com/php/php-src/commit/2d03197749696ac3f8effba6b7977b0d8729fef3
- sed -ri \
- -e '/freetype-config/d' \
- "$version/$suite/$variant/Dockerfile"
- fi
- if [[ "$suite" == alpine* ]] && [ "$majorVersion" = '7' ] && [ "$minorVersion" -lt '4' ]; then
- # https://github.com/docker-library/php/issues/888
- sed -ri \
- -e '/linux-headers/d' \
- "$version/$suite/$variant/Dockerfile"
- fi
- if [ "$majorVersion" -lt '8' ]; then
- # https://github.com/php/php-src/commit/161adfff3f437bf9370e037a9e2bf593c784ccff
- sed -ri \
- -e 's/--enable-zts/--enable-maintainer-zts/g' \
- "$version/$suite/$variant/Dockerfile"
- fi
-
- # remove any _extra_ blank lines created by the deletions above
- gawk '
- {
- if (NF == 0 || (NF == 1 && $1 == "\\")) {
- blank++
- }
- else {
- blank = 0
- }
-
- if (blank < 2) {
- print
- }
- }
- ' "$version/$suite/$variant/Dockerfile" > "$version/$suite/$variant/Dockerfile.new"
- mv "$version/$suite/$variant/Dockerfile.new" "$version/$suite/$variant/Dockerfile"
-
- sed -ri \
- -e 's!%%DEBIAN_TAG%%!'"$suite-slim"'!' \
- -e 's!%%DEBIAN_SUITE%%!'"$suite"'!' \
- -e 's!%%ALPINE_VERSION%%!'"$alpineVer"'!' \
- "$version/$suite/$variant/Dockerfile"
- dockerfiles+=( "$version/$suite/$variant/Dockerfile" )
- done
- done
-
- (
- set -x
- 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[@]}"
- )
-
- # update entrypoint commands
- for dockerfile in "${dockerfiles[@]}"; do
- cmd="$(awk '$1 == "CMD" { $1 = ""; print }' "$dockerfile" | tail -1 | jq --raw-output '.[0]')"
- entrypoint="$(dirname "$dockerfile")/docker-php-entrypoint"
- sed -i 's! php ! '"$cmd"' !g' "$entrypoint"
- done
-done
+./versions.sh "$@"
+./apply-templates.sh "$@"
diff --git a/version-id.jq b/version-id.jq
new file mode 100644
index 0000000000..c46b391553
--- /dev/null
+++ b/version-id.jq
@@ -0,0 +1,11 @@
+def version_id:
+ # https://www.php.net/phpversion
+ # $version_id = $major_version * 10000 + $minor_version * 100 + $release_version;
+ sub("[a-z].*$"; "")
+ | split(".")
+ | (
+ (.[0] // 0 | tonumber) * 10000
+ + (.[1] // 0 | tonumber) * 100
+ + (.[2] // 0 | tonumber)
+ )
+;
diff --git a/versions.json b/versions.json
new file mode 100644
index 0000000000..3a71d4c928
--- /dev/null
+++ b/versions.json
@@ -0,0 +1,82 @@
+{
+ "7.2": {
+ "ascUrl": "https://www.php.net/distributions/php-7.2.33.tar.xz.asc",
+ "gpgKeys": "1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F",
+ "sha256": "0f160a3483ffce36be5962fab7bcf09d605ee66c5707df83e4195cb796bbb03a",
+ "url": "https://www.php.net/distributions/php-7.2.33.tar.xz",
+ "variants": [
+ "buster/cli",
+ "buster/apache",
+ "buster/fpm",
+ "buster/zts",
+ "stretch/cli",
+ "stretch/apache",
+ "stretch/fpm",
+ "stretch/zts",
+ "alpine3.12/cli",
+ "alpine3.12/fpm",
+ "alpine3.12/zts",
+ "alpine3.11/cli",
+ "alpine3.11/fpm",
+ "alpine3.11/zts"
+ ],
+ "version": "7.2.33"
+ },
+ "7.3": {
+ "ascUrl": "https://www.php.net/distributions/php-7.3.21.tar.xz.asc",
+ "gpgKeys": "CBAF69F173A0FEA4B537F470D66C9593118BCCB6 F38252826ACD957EF380D39F2F7956BC5DA04B5D",
+ "sha256": "4c8b065746ef776d84b7ae47908c21a79e3d4704b86b60d816716b8697c58ce9",
+ "url": "https://www.php.net/distributions/php-7.3.21.tar.xz",
+ "variants": [
+ "buster/cli",
+ "buster/apache",
+ "buster/fpm",
+ "buster/zts",
+ "stretch/cli",
+ "stretch/apache",
+ "stretch/fpm",
+ "stretch/zts",
+ "alpine3.12/cli",
+ "alpine3.12/fpm",
+ "alpine3.12/zts",
+ "alpine3.11/cli",
+ "alpine3.11/fpm",
+ "alpine3.11/zts"
+ ],
+ "version": "7.3.21"
+ },
+ "7.4": {
+ "ascUrl": "https://www.php.net/distributions/php-7.4.9.tar.xz.asc",
+ "gpgKeys": "42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312",
+ "sha256": "23733f4a608ad1bebdcecf0138ebc5fd57cf20d6e0915f98a9444c3f747dc57b",
+ "url": "https://www.php.net/distributions/php-7.4.9.tar.xz",
+ "variants": [
+ "buster/cli",
+ "buster/apache",
+ "buster/fpm",
+ "buster/zts",
+ "alpine3.12/cli",
+ "alpine3.12/fpm",
+ "alpine3.12/zts",
+ "alpine3.11/cli",
+ "alpine3.11/fpm",
+ "alpine3.11/zts"
+ ],
+ "version": "7.4.9"
+ },
+ "8.0-rc": {
+ "ascUrl": "https://downloads.php.net/~pollita/php-8.0.0beta2.tar.xz.asc",
+ "gpgKeys": "1729F83938DA44E27BA0F4D3DBDB397470D12172 BFDDD28642824F8118EF77909B67A5C12229118F",
+ "sha256": "466b2519f54e819bc8907206b30e0e21196a3609e80f27a112c434c7ede3a965",
+ "url": "https://downloads.php.net/~pollita/php-8.0.0beta2.tar.xz",
+ "variants": [
+ "buster/cli",
+ "buster/apache",
+ "buster/fpm",
+ "buster/zts",
+ "alpine3.12/cli",
+ "alpine3.12/fpm"
+ ],
+ "version": "8.0.0beta2"
+ }
+}
diff --git a/versions.sh b/versions.sh
new file mode 100755
index 0000000000..55b4f43973
--- /dev/null
+++ b/versions.sh
@@ -0,0 +1,144 @@
+#!/usr/bin/env bash
+set -Eeuo pipefail
+
+# https://www.php.net/gpg-keys.php
+declare -A gpgKeys=(
+ # https://wiki.php.net/todo/php80
+ # pollita & carusogabriel
+ # https://www.php.net/gpg-keys.php#gpg-8.0
+ [8.0]='1729F83938DA44E27BA0F4D3DBDB397470D12172 BFDDD28642824F8118EF77909B67A5C12229118F'
+
+ # https://wiki.php.net/todo/php74
+ # petk & derick
+ # https://www.php.net/gpg-keys.php#gpg-7.4
+ [7.4]='42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312'
+
+ # https://wiki.php.net/todo/php73
+ # cmb & stas
+ # https://www.php.net/gpg-keys.php#gpg-7.3
+ [7.3]='CBAF69F173A0FEA4B537F470D66C9593118BCCB6 F38252826ACD957EF380D39F2F7956BC5DA04B5D'
+
+ # https://wiki.php.net/todo/php72
+ # pollita & remi
+ # https://www.php.net/downloads.php#gpg-7.2
+ # https://www.php.net/gpg-keys.php#gpg-7.2
+ [7.2]='1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F'
+
+ [7.1]='foo'
+)
+# see https://www.php.net/downloads.php
+
+cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
+
+versions=( "$@" )
+if [ ${#versions[@]} -eq 0 ]; then
+ versions=( */ )
+ json='{}'
+else
+ json="$(< versions.json)"
+fi
+versions=( "${versions[@]%/}" )
+
+for version in "${versions[@]}"; do
+ rcVersion="${version%-rc}"
+ export version rcVersion
+
+ # scrape the relevant API based on whether we're looking for pre-releases
+ if [ "$rcVersion" = "$version" ]; then
+ apiUrl="https://www.php.net/releases/index.php?json&max=100&version=${rcVersion%%.*}"
+ apiJqExpr='
+ (keys[] | select(startswith(env.rcVersion))) as $version
+ | [ $version, (
+ .[$version].source[]
+ | select(.filename | endswith(".xz"))
+ |
+ "https://www.php.net/distributions/" + .filename,
+ "https://www.php.net/distributions/" + .filename + ".asc",
+ .sha256 // "",
+ .md5 // ""
+ ) ]
+ '
+ else
+ apiUrl='https://qa.php.net/api.php?type=qa-releases&format=json'
+ apiJqExpr='
+ .releases[]
+ | select(.version | startswith(env.rcVersion))
+ | [
+ .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 "error: unable to determine available releases of $version"
+ echo >&2
+ exit 1
+ fi
+
+ # 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://www.php.net/downloads.php#gpg-$version"
+ echo >&2 " (and update 'gpgKeys' array in '$BASH_SOURCE')"
+ exit 1
+ fi
+
+ # if we don't have a .asc URL, let's see if we can figure one out :)
+ if [ -z "$ascUrl" ] && wget -q --spider "$url.asc"; then
+ ascUrl="$url.asc"
+ fi
+
+ variants='[]'
+ # order here controls the order of the library/ file
+ for suite in \
+ buster \
+ stretch \
+ alpine3.12 \
+ alpine3.11 \
+ ; do
+ for variant in cli apache fpm zts; do
+ [ -d "$version/$suite/$variant" ] || continue
+ export suite variant
+ variants="$(jq <<<"$variants" -c '. + [ env.suite + "/" + env.variant ]')"
+ done
+ done
+
+ echo "$version: $fullVersion"
+
+ export fullVersion url ascUrl sha256 md5 gpgKey
+ json="$(
+ jq <<<"$json" -c \
+ --argjson variants "$variants" \
+ '.[env.version] = {
+ version: env.fullVersion,
+ url: env.url,
+ ascUrl: env.ascUrl,
+ sha256: env.sha256,
+ gpgKeys: env.gpgKey,
+ variants: $variants,
+ }'
+ )"
+done
+
+jq <<<"$json" -S . > versions.json
diff --git a/zts-Dockerfile-block-1 b/zts-Dockerfile-block-1
deleted file mode 100644
index 5a57553cd2..0000000000
--- a/zts-Dockerfile-block-1
+++ /dev/null
@@ -1 +0,0 @@
-ENV PHP_EXTRA_CONFIGURE_ARGS --enable-zts --disable-cgi