Skip to content

Add an environment variable REDMINE_NO_CHOWN to disable chown/chmod in docker-entrypoint.sh #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion 3.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down
12 changes: 8 additions & 4 deletions 3.3/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion 3.3/passenger/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM redmine:3.3

ENV PASSENGER_VERSION 5.3.2
ENV PASSENGER_VERSION 5.3.3

RUN buildDeps=' \
make \
Expand Down
9 changes: 8 additions & 1 deletion 3.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down
12 changes: 8 additions & 4 deletions 3.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion 3.4/passenger/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM redmine:3.4

ENV PASSENGER_VERSION 5.3.2
ENV PASSENGER_VERSION 5.3.3

RUN buildDeps=' \
make \
Expand Down
9 changes: 8 additions & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down
12 changes: 8 additions & 4 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down