Improve dev environment init process

This ensures that /etc/passwd is always written, regardless of how the container starts.
This commit is contained in:
Shane McDonald
2019-05-10 10:14:51 -04:00
parent 015234287c
commit 7d8a910be7
5 changed files with 24 additions and 17 deletions

View File

@@ -0,0 +1,14 @@
#!/bin/bash
if [ `id -u` -ge 500 ] || [ -z "${CURRENT_UID}" ]; then
cat << EOF > /tmp/passwd
root:x:0:0:root:/root:/bin/bash
awx:x:`id -u`:`id -g`:,,,:/tmp:/bin/bash
EOF
cat /tmp/passwd > /etc/passwd
rm /tmp/passwd
fi
exec $@