diff --git a/php/Dockerfile.Flavours b/php/Dockerfile.Flavours index 6e36b53..d0ac8c5 100644 --- a/php/Dockerfile.Flavours +++ b/php/Dockerfile.Flavours @@ -29,6 +29,7 @@ COPY self-signed-certificates /certs RUN apt-get -qq update && \ # Install pre-dependencies to use apt-key. apt-get -yqq install --no-install-recommends \ + sudo \ lsb-core \ gnupg \ && \ @@ -107,6 +108,9 @@ RUN apt-get -qq update && \ dos2unix -q /etc/service/*/run && \ # Make sure all our new services are executable chmod +x /etc/service/*/run && \ + # Insert shim for php-cli still running in this nginx container to run as www-data. + mv /conf/php-cli-user-shim.sh /usr/local/sbin/php && \ + chmod +x /usr/local/sbin/php && \ # Cleanup the /conf dir rm -R /conf && \ # Write the PHP version into some template locations diff --git a/php/Makefile b/php/Makefile index 6eb038d..d28730e 100644 --- a/php/Makefile +++ b/php/Makefile @@ -33,5 +33,6 @@ bake: $(MAKE) docker-php-core bake-flavours PHP_VERSION=7.3 $(MAKE) docker-php-core bake-flavours PHP_VERSION=7.4 $(MAKE) docker-php-core bake-flavours PHP_VERSION=8.0 + $(MAKE) docker-php-core bake-flavours PHP_VERSION=8.1 all: bake \ No newline at end of file diff --git a/php/nginx/php-cli-user-shim.sh b/php/nginx/php-cli-user-shim.sh new file mode 100644 index 0000000..7a9fc16 --- /dev/null +++ b/php/nginx/php-cli-user-shim.sh @@ -0,0 +1,3 @@ +#!/bin/sh +sudo -u www-data /usr/bin/php "$*" +return $?