Skip to content

Commit

Permalink
Merge pull request #48 from infosiftr/any-user
Browse files Browse the repository at this point in the history
Allow arbitrary --user values
  • Loading branch information
yosifkit committed Feb 23, 2016
2 parents b375650 + b9756ce commit f1d5837
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
5 changes: 3 additions & 2 deletions 2.8/32bit/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
set -e

if [ "$1" = 'redis-server' ]; then
# allow the container to be started with `--user`
if [ "$1" = 'redis-server' -a "$(id -u)" = '0' ]; then
chown -R redis .
exec gosu redis "$@"
exec gosu redis "$BASH_SOURCE" "$@"
fi

exec "$@"
5 changes: 3 additions & 2 deletions 2.8/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
set -e

if [ "$1" = 'redis-server' ]; then
# allow the container to be started with `--user`
if [ "$1" = 'redis-server' -a "$(id -u)" = '0' ]; then
chown -R redis .
exec gosu redis "$@"
exec gosu redis "$BASH_SOURCE" "$@"
fi

exec "$@"
5 changes: 3 additions & 2 deletions 3.0/32bit/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
set -e

if [ "$1" = 'redis-server' ]; then
# allow the container to be started with `--user`
if [ "$1" = 'redis-server' -a "$(id -u)" = '0' ]; then
chown -R redis .
exec gosu redis "$@"
exec gosu redis "$BASH_SOURCE" "$@"
fi

exec "$@"
5 changes: 3 additions & 2 deletions 3.0/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/sh
set -e

if [ "$1" = 'redis-server' ]; then
# allow the container to be started with `--user`
if [ "$1" = 'redis-server' -a "$(id -u)" = '0' ]; then
chown -R redis .
exec gosu redis "$@"
exec gosu redis "$0" "$@"
fi

exec "$@"
5 changes: 3 additions & 2 deletions 3.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
set -e

if [ "$1" = 'redis-server' ]; then
# allow the container to be started with `--user`
if [ "$1" = 'redis-server' -a "$(id -u)" = '0' ]; then
chown -R redis .
exec gosu redis "$@"
exec gosu redis "$BASH_SOURCE" "$@"
fi

exec "$@"

0 comments on commit f1d5837

Please sign in to comment.