Docker: Add a Dockerfile and Makefile targets (#373)

* add docker build option

* add docker section in makefile

* add bash_aliases to get different prompt
This commit is contained in:
Patrik
2017-12-09 17:34:22 +01:00
committed by Philipp Oppermann
parent cf2c5550aa
commit 2e8da22b32
5 changed files with 103 additions and 0 deletions

19
docker/entrypoint.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
USER_NAME=blogos
USER_UID=${LOCAL_UID:-9001}
USER_GID=${LOCAL_GID:-9001}
groupadd --non-unique --gid $USER_GID $USER_NAME
useradd --non-unique --create-home --uid $USER_UID --gid $USER_GID $USER_NAME
export HOME=/home/$USER_NAME
TESTFILE=$RUSTUP_HOME/settings.toml
CACHED_UID=$(stat -c "%u" $TESTFILE)
CACHED_GID=$(stat -c "%g" $TESTFILE)
if [ $CACHED_UID != $USER_UID ] || [ $USER_GID != $CACHED_GID ]; then
chown $USER_UID:$USER_GID -R $CARGO_HOME $RUSTUP_HOME
fi
exec gosu $USER_NAME "$@"