summaryrefslogtreecommitdiffstats
path: root/adei/docker-entrypoint.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-02-22 03:47:37 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-02-22 03:47:37 +0100
commit2a32f59c055f76b3420726930a08a0a95474cc2c (patch)
tree75651f882b60fd485aa8004889ec128829ff9da8 /adei/docker-entrypoint.sh
parent28879b78ddff075daf9d28f6389ecab9909c1de8 (diff)
downloadadei-2a32f59c055f76b3420726930a08a0a95474cc2c.tar.gz
adei-2a32f59c055f76b3420726930a08a0a95474cc2c.tar.bz2
adei-2a32f59c055f76b3420726930a08a0a95474cc2c.tar.xz
adei-2a32f59c055f76b3420726930a08a0a95474cc2c.zip
Simplify and add uid to /etc/passwd on startup to keep getpwuid() happy
Diffstat (limited to 'adei/docker-entrypoint.sh')
-rwxr-xr-xadei/docker-entrypoint.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/adei/docker-entrypoint.sh b/adei/docker-entrypoint.sh
index a82a970..f4d9f20 100755
--- a/adei/docker-entrypoint.sh
+++ b/adei/docker-entrypoint.sh
@@ -2,5 +2,11 @@
set -e
+if ! whoami &> /dev/null; then
+ if [ -w /etc/passwd ]; then
+ echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
+ fi
+fi
+
echo "Running: $@"
exec "$@"