From 2a32f59c055f76b3420726930a08a0a95474cc2c Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 22 Feb 2018 03:47:37 +0100 Subject: Simplify and add uid to /etc/passwd on startup to keep getpwuid() happy --- adei/docker-entrypoint.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'adei/docker-entrypoint.sh') 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 "$@" -- cgit v1.2.3