diff --git a/Dockerfile b/Dockerfile index 659c9e0..237d0db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,10 @@ FROM java:jre MAINTAINER PlusMinus +# For running the JDownloder as a normal user +ENV UID=1000 +ENV GID=1000 + # Create directory, downloader JD" and start JD2 for the initial update and creation of config files. RUN \ diff --git a/startJD2.sh b/startJD2.sh index 99c32c9..8913f33 100755 --- a/startJD2.sh +++ b/startJD2.sh @@ -9,7 +9,10 @@ function stopJD2 { trap stopJD2 EXIT -java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar & +# Add a user to run the jdownloader +useradd -M --uid $UID --gid $GID jduser + +su jduser -c 'java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar &' while true; do sleep inf