Restructured some things and made 1000:100 the default user. Added debian base image, tests and update README.md

This commit is contained in:
PlusMinus0 2018-11-17 22:53:34 +01:00
parent 0084476349
commit e96b9d994f
10 changed files with 126 additions and 54 deletions

32
common/entrypoint.sh Executable file
View file

@ -0,0 +1,32 @@
#!/bin/sh
# Set defaults for uid and gid to not be root
if [ -n $GID ]; then GID=100; fi
if [ -n $UID ]; then UID=1000; fi
if [ "$GID" -ne "0" ]; then
GROUP=jdownloader
groupadd -g $GID $GROUP
else
GROUP=root
fi
if [ "$UID" -ne "0" ]; then
USER=jdownloader
# Create user without home (-M) and remove login shell
useradd -M -s /bin/false -g $GID -u $UID $USER
else
USER=root
usermod -ag $GID
fi
chown -R $UID:$GID /opt/JDownloader
# Sometimes this gets deleted. Just copy it every time.
cp /opt/JDownloader/sevenzip* /opt/JDownloader/libs/
su-exec ${UID}:${GID} "$@"
# Keep container alive when jd2 restarts
while sleep 3600; do :; done