Skip to content

Commit

Permalink
Dont usermod unless userid is set in docker entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
phlax committed Apr 12, 2018
1 parent 99e82df commit eccb8c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions docker/base/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash

# Add local user
# Either use the LOCAL_USER_ID if passed in at runtime or
# fallback
# If local_user_id is set usermod to this user

USER_ID=${LOCAL_USER_ID:$UID}
POOTLE_ID=$(id -u pootle)

if [[ ( ! -z ${LOCAL_USER_ID:+x} ) && ( "$LOCAL_USER_ID" != "$POOTLE_ID" ) ]]; then
echo "Starting with UID : $LOCAL_USER_ID";
usermod -o -u $LOCAL_USER_ID pootle
fi

echo "Starting with UID : $USER_ID"
usermod -o -u $USER_ID pootle
export HOME=/home/pootle
exec gosu pootle "$@"
13 changes: 7 additions & 6 deletions docker/dev-base/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash

# Add local user
# Either use the LOCAL_USER_ID if passed in at runtime or
# fallback
# If local_user_id is set usermod to this user

USER_ID=${LOCAL_USER_ID:$UID}
POOTLE_ID=$(id -u pootle)

if [[ ( ! -z ${LOCAL_USER_ID:+x} ) && ( "$LOCAL_USER_ID" != "$POOTLE_ID" ) ]]; then
echo "Starting with UID : $LOCAL_USER_ID";
usermod -o -u $LOCAL_USER_ID pootle
fi

echo "Starting with UID : $USER_ID"
usermod -o -u $USER_ID pootle
export HOME=/home/pootle
exec gosu pootle "$@"

0 comments on commit eccb8c7

Please sign in to comment.