fix: handle user UID/GID
This commit is contained in:
parent
4131813fa5
commit
4e09526845
2 changed files with 9 additions and 2 deletions
|
@ -9,7 +9,12 @@ echo "Arguments: $ARGS"
|
||||||
EXT_UID=${EXT_UID:-999}
|
EXT_UID=${EXT_UID:-999}
|
||||||
EXT_GID=${EXT_GID:-999}
|
EXT_GID=${EXT_GID:-999}
|
||||||
|
|
||||||
|
if ! grep "^[^:]*:[^:]*:$EXT_UID:" /etc/group ; then
|
||||||
groupadd -g "$EXT_GID" appuser
|
groupadd -g "$EXT_GID" appuser
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! grep "^[^:]*:[^:]*:$EXT_UID:" /etc/passwd ; then
|
||||||
useradd -r -u "$EXT_UID" -g appuser appuser
|
useradd -r -u "$EXT_UID" -g appuser appuser
|
||||||
|
fi
|
||||||
|
|
||||||
exec gosu appuser make "$@"
|
exec gosu appuser make "$@"
|
||||||
|
|
|
@ -26,6 +26,8 @@ docker run -it \
|
||||||
-v "$BASEDIR/images:/app/images" \
|
-v "$BASEDIR/images:/app/images" \
|
||||||
-v "$BASEDIR/_build:/app/_build" \
|
-v "$BASEDIR/_build:/app/_build" \
|
||||||
-v "$BASEDIR/mkdocs.yml:/app/mkdocs.yml" \
|
-v "$BASEDIR/mkdocs.yml:/app/mkdocs.yml" \
|
||||||
|
-e "EXT_UID=$(id -u)" \
|
||||||
|
-e "EXT_GID=$(id -g)" \
|
||||||
$DOCKER_OPT_MARP_THEME \
|
$DOCKER_OPT_MARP_THEME \
|
||||||
-p 5200:5200 \
|
-p 5200:5200 \
|
||||||
-p 5100:5100 \
|
-p 5100:5100 \
|
||||||
|
|
Loading…
Reference in a new issue