mirror of
https://git.netzspielplatz.de/docker-multiarch/jdownloader2-headless.git
synced 2025-11-08 20:39:31 +00:00
commit
9dc7ce329a
12 changed files with 164 additions and 58 deletions
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
*\~
|
||||||
|
.\#*
|
||||||
|
\#*\#
|
||||||
|
.config/
|
||||||
23
.travis.yml
Normal file
23
.travis.yml
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
sudo: required
|
||||||
|
language: generic
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
include:
|
||||||
|
- stage: "Build and Test"
|
||||||
|
before_script:
|
||||||
|
- curl -fsSL https://goss.rocks/install | sudo sh
|
||||||
|
script:
|
||||||
|
- ./build-n-test.sh
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
webhooks:
|
||||||
|
urls:
|
||||||
|
- https://registry.hub.docker.com/u/plusminus/jdownloader2-headless/trigger/e50efaab-36ed-4900-b08d-3cf8944ca9cd/
|
||||||
|
on_success: always
|
||||||
|
on_failure: never
|
||||||
|
on_start: never
|
||||||
|
on_cancel: never
|
||||||
|
on_error: never
|
||||||
23
Dockerfile
23
Dockerfile
|
|
@ -1,23 +0,0 @@
|
||||||
FROM openjdk:8-jre-alpine
|
|
||||||
|
|
||||||
MAINTAINER PlusMinus <piddlpiddl@gmail.com>
|
|
||||||
|
|
||||||
|
|
||||||
# Create directory, and start JD2 for the initial update and creation of config files.
|
|
||||||
RUN \
|
|
||||||
apk add --no-cache --quiet tini su-exec bash && \
|
|
||||||
mkdir -p /opt/JDownloader/libs && \
|
|
||||||
wget -O /opt/JDownloader/JDownloader.jar --user-agent="https://hub.docker.com/r/plusminus/jdownloader2-headless/" http://installer.jdownloader.org/JDownloader.jar && \
|
|
||||||
java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar && \
|
|
||||||
apk add --update ffmpeg
|
|
||||||
|
|
||||||
# Beta sevenzipbindings
|
|
||||||
COPY sevenzip* /opt/JDownloader/
|
|
||||||
|
|
||||||
COPY startJD2.sh /opt/JDownloader/
|
|
||||||
RUN chmod +x /opt/JDownloader/startJD2.sh
|
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["/sbin/tini", "-g", "--", "/opt/JDownloader/startJD2.sh"]
|
|
||||||
# Run this when the container is started
|
|
||||||
CMD ["java", "-Djava.awt.headless=true", "-jar", "/opt/JDownloader/JDownloader.jar"]
|
|
||||||
21
README.md
21
README.md
|
|
@ -1,7 +1,14 @@
|
||||||
# headless-jd2-docker
|
[](https://travis-ci.com/PlusMinus0/headless-jd2-docker)
|
||||||
Headless JDownloader 2 Docker Container
|
# Supported tags
|
||||||
|
* [`latest`, `debian`, `v3-debian` (debian.Dockerfile)](https://github.com/PlusMinus0/headless-jd2-docker/blob/master/debian.Dockerfile)
|
||||||
|
* [`alpine`, `v3-alpine` (alpine.Dockerfile)](https://github.com/PlusMinus0/headless-jd2-docker/blob/master/alpine.Dockerfile)
|
||||||
|
* [`dev-debian` (debian.Dockerfile)](https://github.com/PlusMinus0/headless-jd2-docker/blob/dev/debian.Dockerfile)
|
||||||
|
* [`dev-alpine` (alpine.Dockerfile)](https://github.com/PlusMinus0/headless-jd2-docker/blob/dev/alpine.Dockerfile)
|
||||||
|
* [`v2.1` (Dockerfile)](https://github.com/PlusMinus0/headless-jd2-docker/blob/v2.1/Dockerfile)
|
||||||
|
* [`v2.0` (Dockerfile)](https://github.com/PlusMinus0/headless-jd2-docker/blob/v2.0/Dockerfile)
|
||||||
|
|
||||||
## Running the container
|
|
||||||
|
# Running the container
|
||||||
0. Become root if your user is not part of the docker group:
|
0. Become root if your user is not part of the docker group:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
@ -33,10 +40,10 @@ Headless JDownloader 2 Docker Container
|
||||||
docker start jd2
|
docker start jd2
|
||||||
```
|
```
|
||||||
|
|
||||||
## Optional environment variables
|
# Optional environment variables
|
||||||
|Environment Variable|Description|
|
|Environment Variable|Description|
|
||||||
|--------------------|-----------|
|
|--------------------|-----------|
|
||||||
|UID|Specifies the UID the daemon should run as. All created files will be owned by this UID. Defaults to 0 for root.|
|
|UID|Specifies the UID the daemon should run as. All created files will be owned by this UID. Defaults to 1000.|
|
||||||
|GID|Specifies the GID for all created files. This only works in combination with the UID. Defaults to 0 for root.|
|
|GID|Specifies the GID for all created files. This only works in combination with the UID. Defaults to 100 for users.|
|
||||||
|
|
||||||
Not setting these will default to root:root. If you are required to set all environment varibles, setting these to 0 will fall back to the default.
|
Not setting these will default to 1000:100.
|
||||||
|
|
|
||||||
19
alpine.Dockerfile
Normal file
19
alpine.Dockerfile
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
FROM openjdk:8-jre-alpine
|
||||||
|
|
||||||
|
MAINTAINER PlusMinus <piddlpiddl@gmail.com>
|
||||||
|
|
||||||
|
# Create directory, and start JD2 for the initial update and creation of config files.
|
||||||
|
RUN apk update && apk upgrade && \
|
||||||
|
apk add --no-cache --quiet tini su-exec shadow ffmpeg && \
|
||||||
|
mkdir -p /opt/JDownloader/libs && \
|
||||||
|
wget -O /opt/JDownloader/JDownloader.jar --user-agent="https://hub.docker.com/r/plusminus/jdownloader2-headless/" http://installer.jdownloader.org/JDownloader.jar && \
|
||||||
|
java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar
|
||||||
|
|
||||||
|
# Beta sevenzipbindings and entrypoint
|
||||||
|
COPY common/* /opt/JDownloader/
|
||||||
|
RUN chmod +x /opt/JDownloader/entrypoint.sh
|
||||||
|
|
||||||
|
|
||||||
|
ENTRYPOINT ["tini", "-g", "--", "/opt/JDownloader/entrypoint.sh"]
|
||||||
|
# Run this when the container is started
|
||||||
|
CMD ["java", "-Djava.awt.headless=true", "-jar", "/opt/JDownloader/JDownloader.jar"]
|
||||||
21
build-n-test.sh
Executable file
21
build-n-test.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
images=('alpine' 'debian')
|
||||||
|
|
||||||
|
if [ "$(docker version --format '{{.Server.Experimental}}')" = 'true' ]; then
|
||||||
|
export DOCKER_BUILDKIT=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
for image in "${images[@]}"; do
|
||||||
|
tag="jd2dev:${image}"
|
||||||
|
|
||||||
|
echo "Building $tag"
|
||||||
|
docker build -t $tag -f $image.Dockerfile .
|
||||||
|
|
||||||
|
echo "Testing image"
|
||||||
|
dgoss run $tag
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
23
debian.Dockerfile
Normal file
23
debian.Dockerfile
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
FROM openjdk:11-jre-slim-sid
|
||||||
|
|
||||||
|
MAINTAINER PlusMinus <piddlpiddl@gmail.com>
|
||||||
|
|
||||||
|
# Create directory, and start JD2 for the initial update and creation of config files.
|
||||||
|
RUN apt-get update && apt-get dist-upgrade -yqq && \
|
||||||
|
apt-get install -yqq tini ffmpeg wget make gcc && \
|
||||||
|
mkdir -p /opt/JDownloader/libs && \
|
||||||
|
wget -O /opt/JDownloader/JDownloader.jar --user-agent="https://hub.docker.com/r/plusminus/jdownloader2-headless/" http://installer.jdownloader.org/JDownloader.jar && \
|
||||||
|
java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar && \
|
||||||
|
mkdir -p /tmp/ && \
|
||||||
|
wget -O /tmp/su-exec.tar.gz https://github.com/ncopa/su-exec/archive/v0.2.tar.gz && \
|
||||||
|
cd /tmp/ && tar -xf su-exec.tar.gz && cd su-exec-0.2 && make && cp su-exec /usr/bin &&\
|
||||||
|
apt-get purge -yqq wget make gcc && apt-get autoremove -yqq && cd / && rm -rf tmp
|
||||||
|
|
||||||
|
# Beta sevenzipbindings and entrypoint
|
||||||
|
COPY common/* /opt/JDownloader/
|
||||||
|
RUN chmod +x /opt/JDownloader/entrypoint.sh
|
||||||
|
|
||||||
|
|
||||||
|
ENTRYPOINT ["tini", "-g", "--", "/opt/JDownloader/entrypoint.sh"]
|
||||||
|
# Run this when the container is started
|
||||||
|
CMD ["java", "-Djava.awt.headless=true", "-jar", "/opt/JDownloader/JDownloader.jar"]
|
||||||
28
goss.yaml
Normal file
28
goss.yaml
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
file:
|
||||||
|
/opt/JDownloader/JDownloader.jar:
|
||||||
|
exists: true
|
||||||
|
mode: "0644"
|
||||||
|
filetype: file
|
||||||
|
contains: []
|
||||||
|
/opt/JDownloader/sevenzipjbinding1509.jar:
|
||||||
|
exists: true
|
||||||
|
mode: "0664"
|
||||||
|
filetype: file
|
||||||
|
contains: []
|
||||||
|
/opt/JDownloader/sevenzipjbinding1509Linux.jar:
|
||||||
|
exists: true
|
||||||
|
mode: "0664"
|
||||||
|
filetype: file
|
||||||
|
contains: []
|
||||||
|
package:
|
||||||
|
ffmpeg:
|
||||||
|
installed: true
|
||||||
|
user:
|
||||||
|
jdownloader:
|
||||||
|
exists: true
|
||||||
|
uid: 1000
|
||||||
|
gid: 100
|
||||||
|
groups:
|
||||||
|
- users
|
||||||
|
home: []
|
||||||
|
shell: /bin/false
|
||||||
28
startJD2.sh
28
startJD2.sh
|
|
@ -1,28 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ "$GID" ] && [ "$GID" -ne "0" ]
|
|
||||||
then
|
|
||||||
GROUP=jdownloader
|
|
||||||
addgroup -g $GID $GROUP
|
|
||||||
else
|
|
||||||
GROUP=root
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$UID" ] && [ "$UID" -ne "0" ]
|
|
||||||
then
|
|
||||||
USER=jdownloader
|
|
||||||
adduser -S -D -s /bin/false -u $UID $USER
|
|
||||||
else
|
|
||||||
USER=root
|
|
||||||
fi
|
|
||||||
|
|
||||||
adduser -G $GROUP $USER
|
|
||||||
chown -R $USER:$GROUP /opt/JDownloader
|
|
||||||
|
|
||||||
# Sometimes this gets deleted. Just copy it every time.
|
|
||||||
cp /opt/JDownloader/sevenzip* /opt/JDownloader/libs/
|
|
||||||
|
|
||||||
su-exec ${USER}:${GROUP} "$@"
|
|
||||||
|
|
||||||
# Keep container alive when jd2 restarts
|
|
||||||
while sleep 3600; do :; done
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue