From d5c6501cc43c071be16ed9a660899c102a103b34 Mon Sep 17 00:00:00 2001 From: Steevan BARBOYON Date: Mon, 6 Dec 2021 11:25:31 +0100 Subject: [PATCH] Add PHP 8.1 --- docker/Dockerfile | 6 ++++++ docker/build | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 9b2ed1d..60fbde0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -27,6 +27,7 @@ RUN \ php7.3-fpm php7.3-xml php7.3-intl php7.3-mysql php7.3-mbstring php7.3-curl php7.3-zip php7.3-apcu \ php7.4-fpm php7.4-xml php7.4-intl php7.4-mysql php7.4-mbstring php7.4-curl php7.4-zip php7.4-apcu \ php8.0-fpm php8.0-xml php8.0-intl php8.0-mysql php8.0-mbstring php8.0-curl php8.0-zip php8.0-apcu \ + php8.1-fpm php8.1-xml php8.1-intl php8.1-mysql php8.1-mbstring php8.1-curl php8.1-zip php8.1-apcu \ # Fix update-alternatives warning && touch /usr/share/man/man1/php5.6.40.gz \ && touch /usr/share/man/man1/php7.0.33.gz \ @@ -42,6 +43,7 @@ RUN \ && echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/bin/update-alternatives --set php /usr/bin/php7.3" >> /etc/sudoers.d/phpbenchmarks \ && echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/bin/update-alternatives --set php /usr/bin/php7.4" >> /etc/sudoers.d/phpbenchmarks \ && echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/bin/update-alternatives --set php /usr/bin/php8.0" >> /etc/sudoers.d/phpbenchmarks \ + && echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/bin/update-alternatives --set php /usr/bin/php8.1" >> /etc/sudoers.d/phpbenchmarks \ && echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/sbin/service nginx reload" >> /etc/sudoers.d/phpbenchmarks \ && echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/sbin/service php5.6-fpm restart" >> /etc/sudoers.d/phpbenchmarks \ && echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/sbin/service php7.0-fpm restart" >> /etc/sudoers.d/phpbenchmarks \ @@ -50,6 +52,7 @@ RUN \ && echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/sbin/service php7.3-fpm restart" >> /etc/sudoers.d/phpbenchmarks \ && echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/sbin/service php7.4-fpm restart" >> /etc/sudoers.d/phpbenchmarks \ && echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/sbin/service php8.0-fpm restart" >> /etc/sudoers.d/phpbenchmarks \ + && echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/sbin/service php8.1-fpm restart" >> /etc/sudoers.d/phpbenchmarks \ && chmod -R 777 \ /etc/nginx/sites-enabled \ /var/log/nginx \ @@ -60,6 +63,7 @@ RUN \ /etc/php/7.3/fpm/conf.d \ /etc/php/7.4/fpm/conf.d \ /etc/php/8.0/fpm/conf.d \ + /etc/php/8.1/fpm/conf.d \ # Create phpbenchmarks user, we assume final host user id will be 1000 (should be it 99% of the time) && useradd -ms /bin/bash --uid 1000 phpbenchmarks \ && usermod -a -G www-data phpbenchmarks \ @@ -79,6 +83,8 @@ RUN \ && sed -i 's/group = www-data/group = phpbenchmarks/g' /etc/php/7.4/fpm/pool.d/www.conf \ && sed -i 's/user = www-data/user = phpbenchmarks/g' /etc/php/8.0/fpm/pool.d/www.conf \ && sed -i 's/group = www-data/group = phpbenchmarks/g' /etc/php/8.0/fpm/pool.d/www.conf \ + && sed -i 's/user = www-data/user = phpbenchmarks/g' /etc/php/8.1/fpm/pool.d/www.conf \ + && sed -i 's/group = www-data/group = phpbenchmarks/g' /etc/php/8.1/fpm/pool.d/www.conf \ # Define PHP 7.4 as default && /usr/bin/update-alternatives --set php /usr/bin/php7.4 \ # Remove nginx default page diff --git a/docker/build b/docker/build index 8a82093..eb00461 100755 --- a/docker/build +++ b/docker/build @@ -6,7 +6,7 @@ readonly ROOT_DIRECTORY=$(realpath $(dirname $(realpath $0))/..) readonly VERSION_PATH="${ROOT_DIRECTORY}/src/Version.php" readonly IMAGE_NAME="phpbenchmarks/benchmark-kit" readonly LOG_FILE="/tmp/benchmark-kit_build.log" -readonly DOCKER_COMPOSER_CMD="docker run -it --user $(id -u):$(id -g) -v ${ROOT_DIRECTORY}:/app composer:1.10" +readonly DOCKER_COMPOSER_CMD="docker run -it --user $(id -u):$(id -g) -v ${ROOT_DIRECTORY}:/app composer:1.10.17" echo "Fetch Benchmark kit version." readonly DOCKER_VERSION_CMD="docker run --rm -v ${ROOT_DIRECTORY}/src/Version.php:/app/src/Version.php php:7.4-cli-alpine3.10 php -r"