Skip to content

Commit

Permalink
Merge pull request #81 from infosiftr/any-user
Browse files Browse the repository at this point in the history
Allow arbitrary --user values
  • Loading branch information
yosifkit committed Jan 27, 2016
2 parents 890eccb + 7da0e6d commit 5e361e3
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 18 deletions.
8 changes: 5 additions & 3 deletions 2.2/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ if [ "${1:0:1}" = '-' ]; then
set -- mongod "$@"
fi

if [ "$1" = 'mongod' ]; then
# allow the container to be started with `--user`
if [ "$1" = 'mongod' -a "$(id -u)" = '0' ]; then
chown -R mongodb /data/configdb /data/db
exec gosu mongodb "$BASH_SOURCE" "$@"
fi

if [ "$1" = 'mongod' ]; then
numa='numactl --interleave=all'
if $numa true &> /dev/null; then
set -- $numa "$@"
fi

exec gosu mongodb "$@"
fi

exec "$@"
8 changes: 5 additions & 3 deletions 2.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ if [ "${1:0:1}" = '-' ]; then
set -- mongod "$@"
fi

if [ "$1" = 'mongod' ]; then
# allow the container to be started with `--user`
if [ "$1" = 'mongod' -a "$(id -u)" = '0' ]; then
chown -R mongodb /data/configdb /data/db
exec gosu mongodb "$BASH_SOURCE" "$@"
fi

if [ "$1" = 'mongod' ]; then
numa='numactl --interleave=all'
if $numa true &> /dev/null; then
set -- $numa "$@"
fi

exec gosu mongodb "$@"
fi

exec "$@"
8 changes: 5 additions & 3 deletions 2.6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ if [ "${1:0:1}" = '-' ]; then
set -- mongod "$@"
fi

if [ "$1" = 'mongod' ]; then
# allow the container to be started with `--user`
if [ "$1" = 'mongod' -a "$(id -u)" = '0' ]; then
chown -R mongodb /data/configdb /data/db
exec gosu mongodb "$BASH_SOURCE" "$@"
fi

if [ "$1" = 'mongod' ]; then
numa='numactl --interleave=all'
if $numa true &> /dev/null; then
set -- $numa "$@"
fi

exec gosu mongodb "$@"
fi

exec "$@"
8 changes: 5 additions & 3 deletions 3.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ if [ "${1:0:1}" = '-' ]; then
set -- mongod "$@"
fi

if [ "$1" = 'mongod' ]; then
# allow the container to be started with `--user`
if [ "$1" = 'mongod' -a "$(id -u)" = '0' ]; then
chown -R mongodb /data/configdb /data/db
exec gosu mongodb "$BASH_SOURCE" "$@"
fi

if [ "$1" = 'mongod' ]; then
numa='numactl --interleave=all'
if $numa true &> /dev/null; then
set -- $numa "$@"
fi

exec gosu mongodb "$@"
fi

exec "$@"
8 changes: 5 additions & 3 deletions 3.1/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ if [ "${1:0:1}" = '-' ]; then
set -- mongod "$@"
fi

if [ "$1" = 'mongod' ]; then
# allow the container to be started with `--user`
if [ "$1" = 'mongod' -a "$(id -u)" = '0' ]; then
chown -R mongodb /data/configdb /data/db
exec gosu mongodb "$BASH_SOURCE" "$@"
fi

if [ "$1" = 'mongod' ]; then
numa='numactl --interleave=all'
if $numa true &> /dev/null; then
set -- $numa "$@"
fi

exec gosu mongodb "$@"
fi

exec "$@"
8 changes: 5 additions & 3 deletions 3.2/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ if [ "${1:0:1}" = '-' ]; then
set -- mongod "$@"
fi

if [ "$1" = 'mongod' ]; then
# allow the container to be started with `--user`
if [ "$1" = 'mongod' -a "$(id -u)" = '0' ]; then
chown -R mongodb /data/configdb /data/db
exec gosu mongodb "$BASH_SOURCE" "$@"
fi

if [ "$1" = 'mongod' ]; then
numa='numactl --interleave=all'
if $numa true &> /dev/null; then
set -- $numa "$@"
fi

exec gosu mongodb "$@"
fi

exec "$@"

0 comments on commit 5e361e3

Please sign in to comment.