From d711bdbf8d7269cda0e1a0b172dc43dc4d121c42 Mon Sep 17 00:00:00 2001 From: Philippe Marzouk Date: Tue, 26 Jun 2018 17:39:43 +0200 Subject: [PATCH 1/4] add environment variable to disable calling chown/chmod --- 3.4/docker-entrypoint.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/3.4/docker-entrypoint.sh b/3.4/docker-entrypoint.sh index e0a4ff5a..aeebb7ac 100755 --- a/3.4/docker-entrypoint.sh +++ b/3.4/docker-entrypoint.sh @@ -128,10 +128,14 @@ case "$1" in gosu redmine rake db:migrate fi - # https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-8-File-system-permissions - chown -R redmine:redmine files log public/plugin_assets - # directories 755, files 644: - chmod -R ugo-x,u+rwX,go+rX,go-w files log tmp public/plugin_assets + file_env 'REDMINE_NO_CHOWN' '' + + if [ "$REDMINE_NO_CHOWN" == "" ]; then + # https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-8-File-system-permissions + chown -R redmine:redmine files log public/plugin_assets + # directories 755, files 644: + chmod -R ugo-x,u+rwX,go+rX,go-w files log tmp public/plugin_assets + fi if [ "$1" != 'rake' -a -n "$REDMINE_PLUGINS_MIGRATE" ]; then gosu redmine rake redmine:plugins:migrate From c8acca799a2acbb02c1550c023e9b553c890fdee Mon Sep 17 00:00:00 2001 From: Philippe Marzouk Date: Wed, 27 Jun 2018 07:26:24 +0000 Subject: [PATCH 2/4] add environment variable to disable calling chown/chmod (in master docker-entrypoint.sh) --- docker-entrypoint.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index e0a4ff5a..db2543af 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -127,11 +127,15 @@ case "$1" in if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then gosu redmine rake db:migrate fi + + file_env 'REDMINE_NO_CHOWN' '' - # https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-8-File-system-permissions - chown -R redmine:redmine files log public/plugin_assets - # directories 755, files 644: - chmod -R ugo-x,u+rwX,go+rX,go-w files log tmp public/plugin_assets + if [ "$REDMINE_NO_CHOWN" == "" ]; then + # https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-8-File-system-permissions + chown -R redmine:redmine files log public/plugin_assets + # directories 755, files 644: + chmod -R ugo-x,u+rwX,go+rX,go-w files log tmp public/plugin_assets + fi if [ "$1" != 'rake' -a -n "$REDMINE_PLUGINS_MIGRATE" ]; then gosu redmine rake redmine:plugins:migrate From 55d4c2ed435aeeb989f953aa1455a7f4be55dbf0 Mon Sep 17 00:00:00 2001 From: Philippe Marzouk Date: Wed, 27 Jun 2018 07:27:29 +0000 Subject: [PATCH 3/4] Add workaround for intermittent issue with keyserver for gosu gpg key download --- Dockerfile.template | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile.template b/Dockerfile.template index 45c29e95..e8d2ac2b 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -32,7 +32,14 @@ RUN set -eux; \ wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ export GNUPGHOME="$(mktemp -d)"; \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ + # from https://github.com/tianon/gosu/issues/35#issuecomment-299205512 to avoid intermittent issues with some keyservers + for server in $(shuf -e ha.pool.sks-keyservers.net \ + hkp://p80.pool.sks-keyservers.net:80 \ + keyserver.ubuntu.com \ + hkp://keyserver.ubuntu.com:80 \ + pgp.mit.edu) ; do \ + gpg --keyserver "$server" --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && break || : ; \ + done; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ gpgconf --kill all; \ rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \ From f6a52632b9660dc1ae6b544c5ce7bb44b30a05e4 Mon Sep 17 00:00:00 2001 From: Philippe Marzouk Date: Wed, 27 Jun 2018 07:28:24 +0000 Subject: [PATCH 4/4] commit after running update.sh --- 3.3/Dockerfile | 9 ++++++++- 3.3/docker-entrypoint.sh | 12 ++++++++---- 3.3/passenger/Dockerfile | 2 +- 3.4/Dockerfile | 9 ++++++++- 3.4/docker-entrypoint.sh | 2 +- 3.4/passenger/Dockerfile | 2 +- 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/3.3/Dockerfile b/3.3/Dockerfile index b37a6ed9..87cf3d64 100644 --- a/3.3/Dockerfile +++ b/3.3/Dockerfile @@ -32,7 +32,14 @@ RUN set -eux; \ wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ export GNUPGHOME="$(mktemp -d)"; \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ + # from https://github.com/tianon/gosu/issues/35#issuecomment-299205512 to avoid intermittent issues with some keyservers + for server in $(shuf -e ha.pool.sks-keyservers.net \ + hkp://p80.pool.sks-keyservers.net:80 \ + keyserver.ubuntu.com \ + hkp://keyserver.ubuntu.com:80 \ + pgp.mit.edu) ; do \ + gpg --keyserver "$server" --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && break || : ; \ + done; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ gpgconf --kill all; \ rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \ diff --git a/3.3/docker-entrypoint.sh b/3.3/docker-entrypoint.sh index e0a4ff5a..db2543af 100755 --- a/3.3/docker-entrypoint.sh +++ b/3.3/docker-entrypoint.sh @@ -127,11 +127,15 @@ case "$1" in if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then gosu redmine rake db:migrate fi + + file_env 'REDMINE_NO_CHOWN' '' - # https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-8-File-system-permissions - chown -R redmine:redmine files log public/plugin_assets - # directories 755, files 644: - chmod -R ugo-x,u+rwX,go+rX,go-w files log tmp public/plugin_assets + if [ "$REDMINE_NO_CHOWN" == "" ]; then + # https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-8-File-system-permissions + chown -R redmine:redmine files log public/plugin_assets + # directories 755, files 644: + chmod -R ugo-x,u+rwX,go+rX,go-w files log tmp public/plugin_assets + fi if [ "$1" != 'rake' -a -n "$REDMINE_PLUGINS_MIGRATE" ]; then gosu redmine rake redmine:plugins:migrate diff --git a/3.3/passenger/Dockerfile b/3.3/passenger/Dockerfile index 3ac5e12d..7bd8c8c2 100644 --- a/3.3/passenger/Dockerfile +++ b/3.3/passenger/Dockerfile @@ -1,6 +1,6 @@ FROM redmine:3.3 -ENV PASSENGER_VERSION 5.3.2 +ENV PASSENGER_VERSION 5.3.3 RUN buildDeps=' \ make \ diff --git a/3.4/Dockerfile b/3.4/Dockerfile index 270921be..c84ae84f 100644 --- a/3.4/Dockerfile +++ b/3.4/Dockerfile @@ -32,7 +32,14 @@ RUN set -eux; \ wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ export GNUPGHOME="$(mktemp -d)"; \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ + # from https://github.com/tianon/gosu/issues/35#issuecomment-299205512 to avoid intermittent issues with some keyservers + for server in $(shuf -e ha.pool.sks-keyservers.net \ + hkp://p80.pool.sks-keyservers.net:80 \ + keyserver.ubuntu.com \ + hkp://keyserver.ubuntu.com:80 \ + pgp.mit.edu) ; do \ + gpg --keyserver "$server" --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && break || : ; \ + done; \ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ gpgconf --kill all; \ rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \ diff --git a/3.4/docker-entrypoint.sh b/3.4/docker-entrypoint.sh index aeebb7ac..db2543af 100755 --- a/3.4/docker-entrypoint.sh +++ b/3.4/docker-entrypoint.sh @@ -127,7 +127,7 @@ case "$1" in if [ "$1" != 'rake' -a -z "$REDMINE_NO_DB_MIGRATE" ]; then gosu redmine rake db:migrate fi - + file_env 'REDMINE_NO_CHOWN' '' if [ "$REDMINE_NO_CHOWN" == "" ]; then diff --git a/3.4/passenger/Dockerfile b/3.4/passenger/Dockerfile index c968995c..c905c7cc 100644 --- a/3.4/passenger/Dockerfile +++ b/3.4/passenger/Dockerfile @@ -1,6 +1,6 @@ FROM redmine:3.4 -ENV PASSENGER_VERSION 5.3.2 +ENV PASSENGER_VERSION 5.3.3 RUN buildDeps=' \ make \