mirror of
https://git.netzspielplatz.de/docker-multiarch/jdownloader2-headless.git
synced 2025-11-08 18:59:29 +00:00
Restructured some things and made 1000:100 the default user. Added debian base image, tests and update README.md
This commit is contained in:
parent
0084476349
commit
e96b9d994f
10 changed files with 126 additions and 54 deletions
32
common/entrypoint.sh
Executable file
32
common/entrypoint.sh
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue