-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
83 lines (68 loc) · 2.73 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# NOTE: glibc version of the image is needed for the 7-Zip-JBinding workaround.
FROM jlesage/baseimage-gui:alpine-3.8-glibc-v3.5.1
# Define software download URLs.
ARG JDOWNLOADER_URL=http://installer.jdownloader.org/JDownloader.jar
ARG ORACLEJAVAJRE_URL=https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/server-jre-8u201-linux-x64.tar.gz
# Define working directory.
WORKDIR /tmp
# Download JDownloader 2.
RUN \
mkdir -p /defaults && \
wget ${JDOWNLOADER_URL} -O /defaults/JDownloader.jar
# Download and install Oracle JRE.
# NOTE: This is needed only for the 7-Zip-JBinding workaround.
RUN \
add-pkg --virtual build-dependencies curl && \
mkdir /opt/jre && \
curl -# -L -H "Cookie: oraclelicense=accept-securebackup-cookie" ${ORACLEJAVAJRE_URL} | tar -xz --strip 2 -C /opt/jre jdk1.8.0_201/jre && \
rm -r /opt/jre/lib/oblique-fonts && \
del-pkg build-dependencies
# Install dependencies.
RUN \
add-pkg \
# For the 7-Zip-JBinding workaround, Oracle JRE is needed instead of
# the Alpine Linux's openjdk native package.
# The libstdc++ package is also needed as part of the 7-Zip-JBinding
# workaround.
#openjdk8-jre \
libstdc++ \
ttf-dejavu \
# For ffmpeg and ffprobe tools.
ffmpeg \
# For rtmpdump tool.
rtmpdump
# Maximize only the main/initial window.
RUN \
sed-patch 's/<application type="normal">/<application type="normal" title="JDownloader 2">/' \
/etc/xdg/openbox/rc.xml
# Generate and install favicons.
RUN \
APP_ICON_URL=https://raw.githubusercontent.com/jlesage/docker-templates/master/jlesage/images/jdownloader-2-icon.png && \
install_app_icon.sh "$APP_ICON_URL"
# Add files.
COPY rootfs/ /
# Install openvpn
RUN apk --no-cache --no-progress upgrade && \
apk --no-cache --no-progress add bash curl ip6tables iptables openvpn \
shadow tini && \
addgroup -S vpn
# crontab to run vpn continousily
RUN crontab -l | { cat; echo "* * * * * /usr/bin/openvpn.sh"; } | crontab -
RUN crontab -l | { cat; echo "* * * * * /usr/bin/currentip.sh"; } | crontab -
# Set environment variables.
ENV APP_NAME="JDownloader 2" \
S6_KILL_GRACETIME=8000
# Expose ports.
# - 3129: For MyJDownloader in Direct Connection mode.
EXPOSE 3129
# map needed volumes
VOLUME ["/config"]
VOLUME ["/output"]
VOLUME ["/vpn"]
# Metadata.
LABEL \
org.label-schema.name="jdownloader-2" \
org.label-schema.description="Docker container for JDownloader 2" \
org.label-schema.version="unknown" \
org.label-schema.vcs-url="https://github.com/jlesage/docker-jdownloader-2" \
org.label-schema.schema-version="1.0"