From d20a2d26bd388dea4b3d49e70beba200069b9238 Mon Sep 17 00:00:00 2001 From: Andre Meyering Date: Tue, 7 Nov 2023 11:23:14 +0100 Subject: [PATCH] fix(Dockerfile): Fix permission issue for startup script The startup script could not be started (in my case) because of permission issues. Looking at the log, I saw: ``` rssreader | [s6-init] making user provided files available at /var/run/s6/etc...exited 0. rssreader | [s6-init] ensuring user provided files have correct perms...exited 0. rssreader | [fix-attrs.d] applying ownership & permissions fixes... rssreader | [fix-attrs.d] done. rssreader | [cont-init.d] executing container initialization scripts... rssreader | [cont-init.d] 50-php: executing... rssreader | [cont-init.d] 50-php: exited 0. rssreader | [cont-init.d] 98-wait-for-db: executing... rssreader | Checking database responds within 1s on postgres:5432... rssreader | [cont-init.d] 98-wait-for-db: exited 0. rssreader | [cont-init.d] 99-ttrss: executing... rssreader | /var/run/s6/etc/cont-init.d/99-ttrss: line 2: ./setup-ttrss.sh: Permission denied rssreader | [cont-init.d] 99-ttrss: exited 126. rssreader | [cont-init.d] done. rssreader | [services.d] starting services rssreader | ./run: cd: line 4: can't cd to /var/www/ttrss: No such file or directory rssreader | nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/nginx.conf:39 ``` By passing `--chown`, we set the file owner to what s6 expects. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6fa797f..c9fd22f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN set -xe && \ RUN adduser -u 82 -D -S -G www-data www-data # Copy root file system. -COPY root / +COPY --chown=www-data:www-data root / # Add s6 overlay. #ARG S6_OVERLAY_VERSION=3.1.5.0