From 17e8ff71d7b7340975e9e17c20c458626978d281 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Sun, 11 Dec 2022 16:36:54 +0000 Subject: [PATCH 1/3] Rebase to Alpine 3.17 --- .github/workflows/call_invalid_helper.yml | 12 +++++ Dockerfile | 48 +++++++++---------- Dockerfile.aarch64 | 48 +++++++++---------- Dockerfile.armhf | 48 +++++++++---------- README.md | 3 +- readme-vars.yml | 3 +- .../dependencies.d/init-grav-config | 0 .../dependencies.d/init-config | 0 .../init-grav-config/run} | 4 +- root/etc/s6-rc.d/init-grav-config/type | 1 + root/etc/s6-rc.d/init-grav-config/up | 1 + .../svc-cron/dependencies.d/init-services | 0 root/etc/s6-rc.d/svc-cron/run | 3 ++ root/etc/s6-rc.d/svc-cron/type | 1 + .../s6-rc.d/user/contents.d/init-grav-config | 0 root/etc/s6-rc.d/user/contents.d/svc-cron | 0 root/etc/services.d/cron/run | 3 -- 17 files changed, 96 insertions(+), 79 deletions(-) create mode 100644 .github/workflows/call_invalid_helper.yml create mode 100644 root/etc/s6-rc.d/init-config-end/dependencies.d/init-grav-config create mode 100644 root/etc/s6-rc.d/init-grav-config/dependencies.d/init-config rename root/etc/{cont-init.d/50-config => s6-rc.d/init-grav-config/run} (94%) mode change 100644 => 100755 create mode 100644 root/etc/s6-rc.d/init-grav-config/type create mode 100644 root/etc/s6-rc.d/init-grav-config/up create mode 100644 root/etc/s6-rc.d/svc-cron/dependencies.d/init-services create mode 100755 root/etc/s6-rc.d/svc-cron/run create mode 100644 root/etc/s6-rc.d/svc-cron/type create mode 100644 root/etc/s6-rc.d/user/contents.d/init-grav-config create mode 100644 root/etc/s6-rc.d/user/contents.d/svc-cron delete mode 100644 root/etc/services.d/cron/run diff --git a/.github/workflows/call_invalid_helper.yml b/.github/workflows/call_invalid_helper.yml new file mode 100644 index 0000000..773767c --- /dev/null +++ b/.github/workflows/call_invalid_helper.yml @@ -0,0 +1,12 @@ +name: Comment on invalid interaction +on: + issues: + types: + - labeled +jobs: + add-comment-on-invalid: + if: github.event.label.name == 'invalid' + permissions: + issues: write + uses: linuxserver/github-workflows/.github/workflows/invalid-interaction-helper.yml@v1 + secrets: inherit diff --git a/Dockerfile b/Dockerfile index e90d40c..4202cae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.17 ARG BUILD_DATE ARG VERSION @@ -11,30 +11,29 @@ RUN \ apk add --no-cache \ busybox-suid \ composer \ - curl \ - php8-ctype \ - php8-curl \ - php8-dom \ - php8-gd \ - php8-intl \ - php8-json \ - php8-mbstring \ - php8-opcache \ - php8-openssl \ - php8-pecl-apcu \ - php8-pecl-yaml \ - php8-phar \ - php8-redis \ - php8-session \ - php8-simplexml \ - php8-tokenizer \ - php8-xml \ - php8-zip \ + php81-ctype \ + php81-curl \ + php81-dom \ + php81-gd \ + php81-intl \ + php81-json \ + php81-mbstring \ + php81-opcache \ + php81-openssl \ + php81-pecl-apcu \ + php81-pecl-yaml \ + php81-phar \ + php81-redis \ + php81-session \ + php81-simplexml \ + php81-tokenizer \ + php81-xml \ + php81-zip \ unzip && \ echo "**** configure php-fpm to pass env vars ****" && \ - sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ - grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ - echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php8/php-fpm.conf && \ + sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \ + grep -qxF 'clear_env = no' /etc/php81/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php81/php-fpm.d/www.conf && \ + echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php81/php-fpm.conf && \ echo "**** setup php opcache ****" && \ { \ echo 'opcache.memory_consumption=128'; \ @@ -42,7 +41,7 @@ RUN \ echo 'opcache.max_accelerated_files=4000'; \ echo 'opcache.revalidate_freq=2'; \ echo 'opcache.enable_cli=1'; \ - } > /etc/php8/conf.d/php-opcache.ini && \ + } > /etc/php81/conf.d/php-opcache.ini && \ if [ -z ${GRAV_RELEASE+x} ]; then \ GRAV_RELEASE=$(curl -sX GET "https://api.github.com/repos/getgrav/grav/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ @@ -67,4 +66,5 @@ COPY root/ / # ports and volumes EXPOSE 80 443 + VOLUME /config diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 4f08302..8030a0f 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.17 ARG BUILD_DATE ARG VERSION @@ -11,30 +11,29 @@ RUN \ apk add --no-cache \ busybox-suid \ composer \ - curl \ - php8-ctype \ - php8-curl \ - php8-dom \ - php8-gd \ - php8-intl \ - php8-json \ - php8-mbstring \ - php8-opcache \ - php8-openssl \ - php8-pecl-apcu \ - php8-pecl-yaml \ - php8-phar \ - php8-redis \ - php8-session \ - php8-simplexml \ - php8-tokenizer \ - php8-xml \ - php8-zip \ + php81-ctype \ + php81-curl \ + php81-dom \ + php81-gd \ + php81-intl \ + php81-json \ + php81-mbstring \ + php81-opcache \ + php81-openssl \ + php81-pecl-apcu \ + php81-pecl-yaml \ + php81-phar \ + php81-redis \ + php81-session \ + php81-simplexml \ + php81-tokenizer \ + php81-xml \ + php81-zip \ unzip && \ echo "**** configure php-fpm to pass env vars ****" && \ - sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ - grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ - echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php8/php-fpm.conf && \ + sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \ + grep -qxF 'clear_env = no' /etc/php81/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php81/php-fpm.d/www.conf && \ + echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php81/php-fpm.conf && \ echo "**** setup php opcache ****" && \ { \ echo 'opcache.memory_consumption=128'; \ @@ -42,7 +41,7 @@ RUN \ echo 'opcache.max_accelerated_files=4000'; \ echo 'opcache.revalidate_freq=2'; \ echo 'opcache.enable_cli=1'; \ - } > /etc/php8/conf.d/php-opcache.ini && \ + } > /etc/php81/conf.d/php-opcache.ini && \ if [ -z ${GRAV_RELEASE+x} ]; then \ GRAV_RELEASE=$(curl -sX GET "https://api.github.com/repos/getgrav/grav/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ @@ -67,4 +66,5 @@ COPY root/ / # ports and volumes EXPOSE 80 443 + VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 73f6ddb..8fe438a 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.17 ARG BUILD_DATE ARG VERSION @@ -11,30 +11,29 @@ RUN \ apk add --no-cache \ busybox-suid \ composer \ - curl \ - php8-ctype \ - php8-curl \ - php8-dom \ - php8-gd \ - php8-intl \ - php8-json \ - php8-mbstring \ - php8-opcache \ - php8-openssl \ - php8-pecl-apcu \ - php8-pecl-yaml \ - php8-phar \ - php8-redis \ - php8-session \ - php8-simplexml \ - php8-tokenizer \ - php8-xml \ - php8-zip \ + php81-ctype \ + php81-curl \ + php81-dom \ + php81-gd \ + php81-intl \ + php81-json \ + php81-mbstring \ + php81-opcache \ + php81-openssl \ + php81-pecl-apcu \ + php81-pecl-yaml \ + php81-phar \ + php81-redis \ + php81-session \ + php81-simplexml \ + php81-tokenizer \ + php81-xml \ + php81-zip \ unzip && \ echo "**** configure php-fpm to pass env vars ****" && \ - sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ - grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ - echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php8/php-fpm.conf && \ + sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \ + grep -qxF 'clear_env = no' /etc/php81/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php81/php-fpm.d/www.conf && \ + echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php81/php-fpm.conf && \ echo "**** setup php opcache ****" && \ { \ echo 'opcache.memory_consumption=128'; \ @@ -42,7 +41,7 @@ RUN \ echo 'opcache.max_accelerated_files=4000'; \ echo 'opcache.revalidate_freq=2'; \ echo 'opcache.enable_cli=1'; \ - } > /etc/php8/conf.d/php-opcache.ini && \ + } > /etc/php81/conf.d/php-opcache.ini && \ if [ -z ${GRAV_RELEASE+x} ]; then \ GRAV_RELEASE=$(curl -sX GET "https://api.github.com/repos/getgrav/grav/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ @@ -67,4 +66,5 @@ COPY root/ / # ports and volumes EXPOSE 80 443 + VOLUME /config diff --git a/README.md b/README.md index 55c27e9..2f7b8bd 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ The architectures supported by this image are: For more information check out the [Grav documentation](https://learn.getgrav.org/). Our image includes the [grav-admin](https://github.com/getgrav/grav-plugin-admin) plugin. -To use the CLI tools you need to pass the working directory as part of your exec command (or use an interactive shell), e.g. `docker exec -it -w /app/grav-admin grav bin/gpm` +To use the CLI tools you need to pass the working directory as part of your exec command (or use an interactive shell), e.g. `docker exec -it -w /app/www/public/grav-admin grav bin/gpm` ## Usage @@ -223,6 +223,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **11.12.22:** - Rebase to Alpine 3.17, PHP 8.1. * **05.09.22:** - All php to read envs passed to container. * **20.08.22:** - Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base)). * **03.09.21:** - Added support for Redis caching. diff --git a/readme-vars.yml b/readme-vars.yml index 31df7d4..fbc5a46 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -36,10 +36,11 @@ app_setup_block_enabled: true app_setup_block: | For more information check out the [Grav documentation](https://learn.getgrav.org/). Our image includes the [grav-admin](https://github.com/getgrav/grav-plugin-admin) plugin. - To use the CLI tools you need to pass the working directory as part of your exec command (or use an interactive shell), e.g. `docker exec -it -w /app/grav-admin grav bin/gpm` + To use the CLI tools you need to pass the working directory as part of your exec command (or use an interactive shell), e.g. `docker exec -it -w /app/www/public/grav-admin grav bin/gpm` # changelog changelogs: + - { date: "11.12.22:", desc: "Rebase to Alpine 3.17, PHP 8.1."} - { date: "05.09.22:", desc: "All php to read envs passed to container."} - { date: "20.08.22:", desc: "Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base))." } - { date: "03.09.21:", desc: "Added support for Redis caching."} diff --git a/root/etc/s6-rc.d/init-config-end/dependencies.d/init-grav-config b/root/etc/s6-rc.d/init-config-end/dependencies.d/init-grav-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-rc.d/init-grav-config/dependencies.d/init-config b/root/etc/s6-rc.d/init-grav-config/dependencies.d/init-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/cont-init.d/50-config b/root/etc/s6-rc.d/init-grav-config/run old mode 100644 new mode 100755 similarity index 94% rename from root/etc/cont-init.d/50-config rename to root/etc/s6-rc.d/init-grav-config/run index 01fb1da..042cccc --- a/root/etc/cont-init.d/50-config +++ b/root/etc/s6-rc.d/init-grav-config/run @@ -24,6 +24,6 @@ shopt -u globstar dotglob sed -i 's/enable_auto_updates_check: true/enable_auto_updates_check: false/' /config/www/user/plugins/admin/admin.yaml -chown -R abc:abc \ +lsiown -R abc:abc \ /app \ - /config + /config/www diff --git a/root/etc/s6-rc.d/init-grav-config/type b/root/etc/s6-rc.d/init-grav-config/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/root/etc/s6-rc.d/init-grav-config/type @@ -0,0 +1 @@ +oneshot diff --git a/root/etc/s6-rc.d/init-grav-config/up b/root/etc/s6-rc.d/init-grav-config/up new file mode 100644 index 0000000..7dad09b --- /dev/null +++ b/root/etc/s6-rc.d/init-grav-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-grav-config/run diff --git a/root/etc/s6-rc.d/svc-cron/dependencies.d/init-services b/root/etc/s6-rc.d/svc-cron/dependencies.d/init-services new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-rc.d/svc-cron/run b/root/etc/s6-rc.d/svc-cron/run new file mode 100755 index 0000000..254b7bd --- /dev/null +++ b/root/etc/s6-rc.d/svc-cron/run @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv bash + +exec /usr/sbin/crond -f -S -l 5 diff --git a/root/etc/s6-rc.d/svc-cron/type b/root/etc/s6-rc.d/svc-cron/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/root/etc/s6-rc.d/svc-cron/type @@ -0,0 +1 @@ +longrun diff --git a/root/etc/s6-rc.d/user/contents.d/init-grav-config b/root/etc/s6-rc.d/user/contents.d/init-grav-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-rc.d/user/contents.d/svc-cron b/root/etc/s6-rc.d/user/contents.d/svc-cron new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/services.d/cron/run b/root/etc/services.d/cron/run deleted file mode 100644 index 0c2d77a..0000000 --- a/root/etc/services.d/cron/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/with-contenv bash - -exec /usr/sbin/crond -f -S -l 5 \ No newline at end of file From 15cc1aae78e795e4008af5afed3c606c0e23d6db Mon Sep 17 00:00:00 2001 From: TheSpad Date: Sun, 11 Dec 2022 16:56:03 +0000 Subject: [PATCH 2/3] Fix directory paths --- .../s6-rc.d/init-config-end/dependencies.d/init-grav-config | 0 .../s6-rc.d/init-grav-config/dependencies.d/init-config | 0 root/etc/{ => s6-overlay}/s6-rc.d/init-grav-config/run | 0 root/etc/{ => s6-overlay}/s6-rc.d/init-grav-config/type | 0 root/etc/{ => s6-overlay}/s6-rc.d/init-grav-config/up | 0 .../s6-rc.d/svc-cron/dependencies.d/init-services | 0 root/etc/{ => s6-overlay}/s6-rc.d/svc-cron/run | 0 root/etc/{ => s6-overlay}/s6-rc.d/svc-cron/type | 0 .../etc/{ => s6-overlay}/s6-rc.d/user/contents.d/init-grav-config | 0 root/etc/{ => s6-overlay}/s6-rc.d/user/contents.d/svc-cron | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename root/etc/{ => s6-overlay}/s6-rc.d/init-config-end/dependencies.d/init-grav-config (100%) rename root/etc/{ => s6-overlay}/s6-rc.d/init-grav-config/dependencies.d/init-config (100%) rename root/etc/{ => s6-overlay}/s6-rc.d/init-grav-config/run (100%) rename root/etc/{ => s6-overlay}/s6-rc.d/init-grav-config/type (100%) rename root/etc/{ => s6-overlay}/s6-rc.d/init-grav-config/up (100%) rename root/etc/{ => s6-overlay}/s6-rc.d/svc-cron/dependencies.d/init-services (100%) rename root/etc/{ => s6-overlay}/s6-rc.d/svc-cron/run (100%) rename root/etc/{ => s6-overlay}/s6-rc.d/svc-cron/type (100%) rename root/etc/{ => s6-overlay}/s6-rc.d/user/contents.d/init-grav-config (100%) rename root/etc/{ => s6-overlay}/s6-rc.d/user/contents.d/svc-cron (100%) diff --git a/root/etc/s6-rc.d/init-config-end/dependencies.d/init-grav-config b/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-grav-config similarity index 100% rename from root/etc/s6-rc.d/init-config-end/dependencies.d/init-grav-config rename to root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-grav-config diff --git a/root/etc/s6-rc.d/init-grav-config/dependencies.d/init-config b/root/etc/s6-overlay/s6-rc.d/init-grav-config/dependencies.d/init-config similarity index 100% rename from root/etc/s6-rc.d/init-grav-config/dependencies.d/init-config rename to root/etc/s6-overlay/s6-rc.d/init-grav-config/dependencies.d/init-config diff --git a/root/etc/s6-rc.d/init-grav-config/run b/root/etc/s6-overlay/s6-rc.d/init-grav-config/run similarity index 100% rename from root/etc/s6-rc.d/init-grav-config/run rename to root/etc/s6-overlay/s6-rc.d/init-grav-config/run diff --git a/root/etc/s6-rc.d/init-grav-config/type b/root/etc/s6-overlay/s6-rc.d/init-grav-config/type similarity index 100% rename from root/etc/s6-rc.d/init-grav-config/type rename to root/etc/s6-overlay/s6-rc.d/init-grav-config/type diff --git a/root/etc/s6-rc.d/init-grav-config/up b/root/etc/s6-overlay/s6-rc.d/init-grav-config/up similarity index 100% rename from root/etc/s6-rc.d/init-grav-config/up rename to root/etc/s6-overlay/s6-rc.d/init-grav-config/up diff --git a/root/etc/s6-rc.d/svc-cron/dependencies.d/init-services b/root/etc/s6-overlay/s6-rc.d/svc-cron/dependencies.d/init-services similarity index 100% rename from root/etc/s6-rc.d/svc-cron/dependencies.d/init-services rename to root/etc/s6-overlay/s6-rc.d/svc-cron/dependencies.d/init-services diff --git a/root/etc/s6-rc.d/svc-cron/run b/root/etc/s6-overlay/s6-rc.d/svc-cron/run similarity index 100% rename from root/etc/s6-rc.d/svc-cron/run rename to root/etc/s6-overlay/s6-rc.d/svc-cron/run diff --git a/root/etc/s6-rc.d/svc-cron/type b/root/etc/s6-overlay/s6-rc.d/svc-cron/type similarity index 100% rename from root/etc/s6-rc.d/svc-cron/type rename to root/etc/s6-overlay/s6-rc.d/svc-cron/type diff --git a/root/etc/s6-rc.d/user/contents.d/init-grav-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-grav-config similarity index 100% rename from root/etc/s6-rc.d/user/contents.d/init-grav-config rename to root/etc/s6-overlay/s6-rc.d/user/contents.d/init-grav-config diff --git a/root/etc/s6-rc.d/user/contents.d/svc-cron b/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-cron similarity index 100% rename from root/etc/s6-rc.d/user/contents.d/svc-cron rename to root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-cron From 7d2aa44a61e70902af7d9ac164e0b2d6cb2bf46a Mon Sep 17 00:00:00 2001 From: TheSpad Date: Tue, 13 Dec 2022 22:38:10 +0000 Subject: [PATCH 3/3] Add buildkit syntax --- Dockerfile | 2 ++ Dockerfile.aarch64 | 2 ++ Dockerfile.armhf | 2 ++ 3 files changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4202cae..b276993 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.17 ARG BUILD_DATE diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 8030a0f..403b6cb 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.17 ARG BUILD_DATE diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 8fe438a..35ccc42 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.17 ARG BUILD_DATE