From db33cd79b5b4386b607647b0f64408810182e695 Mon Sep 17 00:00:00 2001 From: nodiscc Date: Thu, 11 Aug 2022 13:24:12 +0200 Subject: [PATCH 1/8] update docker images to use PHP 8 - fixes https://github.com/shaarli/Shaarli/issues/1868 --- Dockerfile | 36 ++++++++++++++++++------------------ Dockerfile.armhf | 36 ++++++++++++++++++------------------ 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6fdfb1f7..6d4341e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,29 +32,29 @@ LABEL maintainer="Shaarli Community" RUN apk --update --no-cache add \ ca-certificates \ nginx \ - php7 \ - php7-ctype \ - php7-curl \ - php7-fpm \ - php7-gd \ - php7-iconv \ - php7-intl \ - php7-json \ - php7-mbstring \ - php7-openssl \ - php7-session \ - php7-xml \ - php7-simplexml \ - php7-zlib \ + php8 \ + php8-ctype \ + php8-curl \ + php8-fpm \ + php8-gd \ + php8-iconv \ + php8-intl \ + php8-json \ + php8-mbstring \ + php8-openssl \ + php8-session \ + php8-xml \ + php8-simplexml \ + php8-zlib \ s6 COPY .docker/nginx.conf /etc/nginx/nginx.conf -COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf +COPY .docker/php-fpm.conf /etc/php8/php-fpm.conf COPY .docker/services.d /etc/services.d -RUN rm -rf /etc/php7/php-fpm.d/www.conf \ - && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \ - && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini +RUN rm -rf /etc/php8/php-fpm.d/www.conf \ + && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php8/php.ini \ + && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php8/php.ini WORKDIR /var/www diff --git a/Dockerfile.armhf b/Dockerfile.armhf index b76295fd..1f3df9f6 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -12,7 +12,7 @@ RUN apk --update --no-cache add py2-pip \ # - Resolve PHP dependencies with Composer FROM arm32v6/alpine:3.16 as composer COPY --from=docs /usr/src/app/shaarli /app/shaarli -RUN apk --update --no-cache add php7-curl php7-mbstring php7-simplexml composer \ +RUN apk --update --no-cache add php8-curl php8-mbstring php8-simplexml composer \ && cd /app/shaarli \ && composer --prefer-dist --no-dev install @@ -34,28 +34,28 @@ LABEL maintainer="Shaarli Community" RUN apk --update --no-cache add \ ca-certificates \ nginx \ - php7 \ - php7-ctype \ - php7-curl \ - php7-fpm \ - php7-gd \ - php7-iconv \ - php7-intl \ - php7-json \ - php7-mbstring \ - php7-openssl \ - php7-session \ - php7-xml \ - php7-zlib \ + php8 \ + php8-ctype \ + php8-curl \ + php8-fpm \ + php8-gd \ + php8-iconv \ + php8-intl \ + php8-json \ + php8-mbstring \ + php8-openssl \ + php8-session \ + php8-xml \ + php8-zlib \ s6 COPY .docker/nginx.conf /etc/nginx/nginx.conf -COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf +COPY .docker/php-fpm.conf /etc/php8/php-fpm.conf COPY .docker/services.d /etc/services.d -RUN rm -rf /etc/php7/php-fpm.d/www.conf \ - && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \ - && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini +RUN rm -rf /etc/php8/php-fpm.d/www.conf \ + && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php8/php.ini \ + && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php8/php.ini WORKDIR /var/www From 1da6caedfb2f5cd41a46ff7fc7778764156bda47 Mon Sep 17 00:00:00 2001 From: nodiscc Date: Thu, 11 Aug 2022 13:43:42 +0200 Subject: [PATCH 2/8] Dockerfile.armhf: upgrade python2 -> python3 - python2 no longer available in alpine 3.16 - ref. https://github.com/shaarli/Shaarli/issues/1048 --- Dockerfile.armhf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 1f3df9f6..c128c9ed 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -3,7 +3,7 @@ # - Build documentation FROM arm32v6/alpine:3.16 as docs ADD . /usr/src/app/shaarli -RUN apk --update --no-cache add py2-pip \ +RUN apk --update --no-cache add py3-pip \ && cd /usr/src/app/shaarli \ && pip install --no-cache-dir mkdocs \ && mkdocs build --clean @@ -20,7 +20,7 @@ RUN apk --update --no-cache add php8-curl php8-mbstring php8-simplexml composer # - Frontend dependencies FROM arm32v6/alpine:3.16 as node COPY --from=composer /app/shaarli /shaarli -RUN apk --update --no-cache add yarn nodejs-current python2 build-base \ +RUN apk --update --no-cache add yarn nodejs-current python3 build-base \ && cd /shaarli \ && yarnpkg install \ && yarnpkg run build \ From b5988ce296feea58f630a513e4e617ed4cf92227 Mon Sep 17 00:00:00 2001 From: nodiscc Date: Sun, 4 Sep 2022 17:47:41 +0200 Subject: [PATCH 3/8] docker: update s6 service definition to use php-fpm8 --- .docker/services.d/php-fpm/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/services.d/php-fpm/run b/.docker/services.d/php-fpm/run index 21dd0107..e46138db 100755 --- a/.docker/services.d/php-fpm/run +++ b/.docker/services.d/php-fpm/run @@ -1,2 +1,2 @@ #!/bin/execlineb -P -php-fpm7 -F +php-fpm8 -F From bd81f942870ac0020032b4697544b18199b697b0 Mon Sep 17 00:00:00 2001 From: nodiscc Date: Sun, 4 Sep 2022 17:49:32 +0200 Subject: [PATCH 4/8] tests: update alpine316 test image to use php8 --- tests/docker/alpine316/Dockerfile | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/docker/alpine316/Dockerfile b/tests/docker/alpine316/Dockerfile index 85e22b09..7fab1a72 100644 --- a/tests/docker/alpine316/Dockerfile +++ b/tests/docker/alpine316/Dockerfile @@ -5,23 +5,23 @@ RUN apk --update --no-cache add \ ca-certificates \ curl \ make \ - php7 \ - php7-ctype \ - php7-curl \ - php7-dom \ - php7-gd \ - php7-iconv \ - php7-intl \ - php7-json \ - php7-mbstring \ - php7-openssl \ - php7-phar \ - php7-session \ - php7-simplexml \ - php7-tokenizer \ - php7-xdebug \ - php7-xml \ - php7-zlib \ + php8 \ + php8-ctype \ + php8-curl \ + php8-dom \ + php8-gd \ + php8-iconv \ + php8-intl \ + php8-json \ + php8-mbstring \ + php8-openssl \ + php8-phar \ + php8-session \ + php8-simplexml \ + php8-tokenizer \ + php8-xdebug \ + php8-xml \ + php8-zlib \ rsync RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer From e0a9d66d990d7cdd341d8aefbeae5dbe8f345b3b Mon Sep 17 00:00:00 2001 From: nodiscc Date: Tue, 13 Sep 2022 17:09:28 +0200 Subject: [PATCH 5/8] tests/makefile: rewrite translate target to be compatible with busybox find - https://manpages.debian.org/bullseye/busybox-static/busybox.1.en.html#find --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index addd2387..1bfcf995 100644 --- a/Makefile +++ b/Makefile @@ -165,7 +165,7 @@ htmldoc: ### Generate Shaarli's translation compiled file (.mo) translate: - @find inc/languages/ -name shaarli.po -execdir msgfmt shaarli.po -o shaarli.mo \; + @for pofile in $(find inc/languages/ -name shaarli.po); do msgfmt "$pofile" -o "$(dirname "$pofile")/$(basename "$pofile" .po).mo"; done ### Run ESLint check against Shaarli's JS files eslint: From 8b1f9115ad8e3322a1886d5d12fedf012dff4579 Mon Sep 17 00:00:00 2001 From: nodiscc Date: Tue, 13 Sep 2022 17:12:41 +0200 Subject: [PATCH 6/8] tests/docker: add php8-xmlwriter packate to alpine316 test image - squizlabs/php_codesniffer[3.0.0, ..., 3.7.1] require ext-xmlwriter * -> it is missing from your system. Install or enable PHP's xmlwriter extension. --- tests/docker/alpine316/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/docker/alpine316/Dockerfile b/tests/docker/alpine316/Dockerfile index 7fab1a72..e7bc6bea 100644 --- a/tests/docker/alpine316/Dockerfile +++ b/tests/docker/alpine316/Dockerfile @@ -20,6 +20,7 @@ RUN apk --update --no-cache add \ php8-simplexml \ php8-tokenizer \ php8-xdebug \ + php8-xmlwriter \ php8-xml \ php8-zlib \ rsync From 74883e373e2b8100e78ba3f80dadc1250abe1f29 Mon Sep 17 00:00:00 2001 From: nodiscc Date: Tue, 13 Sep 2022 17:49:20 +0200 Subject: [PATCH 7/8] docker: Dockerfile: add php8-gettext package --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 6d4341e4..8664a46d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,6 +37,7 @@ RUN apk --update --no-cache add \ php8-curl \ php8-fpm \ php8-gd \ + php8-gettext \ php8-iconv \ php8-intl \ php8-json \ From 5177e036faf61076c6b5de5a88a0b629aa4a400d Mon Sep 17 00:00:00 2001 From: nodiscc Date: Tue, 13 Sep 2022 17:49:45 +0200 Subject: [PATCH 8/8] tests/docker: alpine316: add php8-gettext package --- tests/docker/alpine316/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/docker/alpine316/Dockerfile b/tests/docker/alpine316/Dockerfile index e7bc6bea..03aa0661 100644 --- a/tests/docker/alpine316/Dockerfile +++ b/tests/docker/alpine316/Dockerfile @@ -10,6 +10,7 @@ RUN apk --update --no-cache add \ php8-curl \ php8-dom \ php8-gd \ + php8-gettext \ php8-iconv \ php8-intl \ php8-json \