mirror of
https://git.netzspielplatz.de/docker-multiarch/jdownloader2-headless.git
synced 2025-11-08 21:59:30 +00:00
Add ability to specify a UID and GID
This commit is contained in:
parent
cb23e460a4
commit
08cb2da105
2 changed files with 24 additions and 8 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
FROM openjdk:8-jre
|
FROM openjdk:8-jre
|
||||||
|
|
||||||
MAINTAINER PlusMinus <piddlpiddl@gmail.com>
|
MAINTAINER GoToFoo <admin@gotofoo.eu>
|
||||||
|
|
||||||
|
|
||||||
# Create directory, downloader JD" and start JD2 for the initial update and creation of config files.
|
# Create directory, downloader JD" and start JD2 for the initial update and creation of config files.
|
||||||
RUN \
|
RUN \
|
||||||
|
|
@ -9,10 +8,8 @@ RUN \
|
||||||
wget -O /opt/JDownloader/JDownloader.jar --user-agent="https://hub.docker.com/r/plusminus/jdownloader2-headless/" --progress=bar:force http://installer.jdownloader.org/JDownloader.jar && \
|
wget -O /opt/JDownloader/JDownloader.jar --user-agent="https://hub.docker.com/r/plusminus/jdownloader2-headless/" --progress=bar:force http://installer.jdownloader.org/JDownloader.jar && \
|
||||||
java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar
|
java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar
|
||||||
|
|
||||||
|
|
||||||
COPY startJD2.sh /opt/JDownloader/
|
COPY startJD2.sh /opt/JDownloader/
|
||||||
RUN chmod +x /opt/JDownloader/startJD2.sh
|
RUN chmod +x /opt/JDownloader/startJD2.sh
|
||||||
|
|
||||||
|
|
||||||
# Run this when the container is started
|
# Run this when the container is started
|
||||||
CMD /opt/JDownloader/startJD2.sh
|
CMD /opt/JDownloader/startJD2.sh
|
||||||
|
|
|
||||||
27
startJD2.sh
27
startJD2.sh
|
|
@ -7,11 +7,30 @@ function stopJD2 {
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ "$GID" ]
|
||||||
|
then
|
||||||
|
GROUP=jdownloader
|
||||||
|
groupadd -g $GID $GROUP
|
||||||
|
else
|
||||||
|
GROUP=root
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$UID" ]
|
||||||
|
then
|
||||||
|
USER=jdownloader
|
||||||
|
useradd -r -s /bin/false -u $UID -g $GROUP $USER
|
||||||
|
chown -R $USER:$GROUP /opt/JDownloader
|
||||||
|
else
|
||||||
|
USER=root
|
||||||
|
fi
|
||||||
|
|
||||||
trap stopJD2 EXIT
|
trap stopJD2 EXIT
|
||||||
|
|
||||||
java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar &
|
su -c "java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar" -s /bin/bash $USER
|
||||||
|
|
||||||
while true; do
|
#java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar &
|
||||||
sleep inf
|
|
||||||
done
|
#while true; do
|
||||||
|
# sleep inf
|
||||||
|
#done
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue