Created
August 28, 2019 12:42
-
-
Save hsteinshiromoto/c11df87a6bfec7d451982d2ffa05f162 to your computer and use it in GitHub Desktop.
Wordpress: entrypoint.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# If "-e uid={custom/local user id}" flag is not set for "docker run" command, use 9999 as default | |
CURRENT_UID=${uid:-9999} | |
# Notify user about the UID selected | |
echo "Current UID : $CURRENT_UID" | |
# Create user called "docker" with selected UID | |
useradd --shell /bin/bash -u $CURRENT_UID -o -c "" -m docker | |
# Set "HOME" ENV variable for user's home directory, uncomment in case it has not been set yet | |
# export HOME=/home/docker | |
# Execute process | |
exec gosu docker "$@" | |
# Note that, because gosu is installed via apt-get we only need to run using gosu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment