forked from haugene/docker-transmission-openvpn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
154 lines (127 loc) · 5.72 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
FROM alpine:latest as TransmissionUIs
RUN apk --no-cache add curl jq \
&& mkdir -p /opt/transmission-ui \
&& echo "Install Shift" \
&& wget -qO- https://github.com/killemov/Shift/archive/master.tar.gz | tar xz -C /opt/transmission-ui \
&& mv /opt/transmission-ui/Shift-master /opt/transmission-ui/shift \
&& echo "Install Flood for Transmission" \
&& wget -qO- https://github.com/johman10/flood-for-transmission/releases/download/latest/flood-for-transmission.tar.gz | tar xz -C /opt/transmission-ui \
&& echo "Install Combustion" \
&& wget -qO- https://github.com/Secretmapper/combustion/archive/release.tar.gz | tar xz -C /opt/transmission-ui \
&& echo "Install kettu" \
&& wget -qO- https://github.com/endor/kettu/archive/master.tar.gz | tar xz -C /opt/transmission-ui \
&& mv /opt/transmission-ui/kettu-master /opt/transmission-ui/kettu \
&& echo "Install Transmission-Web-Control" \
&& mkdir /opt/transmission-ui/transmission-web-control \
&& curl -sL $(curl -s https://api.github.com/repos/ronggang/transmission-web-control/releases/latest | jq --raw-output '.tarball_url') | tar -C /opt/transmission-ui/transmission-web-control/ --strip-components=2 -xz \
&& echo "Install Transmissionic" \
&& wget -qO- https://github.com/6c65726f79/Transmissionic/releases/download/v1.8.0/Transmissionic-webui-v1.8.0.zip | unzip -q - \
&& mv web /opt/transmission-ui/transmissionic
FROM ubuntu:22.04 AS base
RUN set -ex; \
apt-get update; \
apt-get dist-upgrade -y; \
apt-get install -y --no-install-recommends \
tzdata \
iproute2 \
net-tools \
nano \
ca-certificates \
curl \
libcurl4-openssl-dev \
libdeflate-dev \
libevent-dev \
libfmt-dev \
libminiupnpc-dev \
libnatpmp-dev \
libpsl-dev \
libssl-dev
FROM base as TransmissionBuilder
ARG DEBIAN_FRONTEND=noninteractive
ARG TBT_VERSION=4.0.4
RUN apt-get update && apt-get install -y curl \
build-essential automake autoconf libtool pkg-config intltool libcurl4-openssl-dev \
libglib2.0-dev libevent-dev libminiupnpc-dev libgtk-3-dev libappindicator3-dev libssl-dev cmake xz-utils checkinstall
RUN mkdir -p /home/transmission4/ && cd /home/transmission4/ \
&& curl -L -o transmission4.tar.xz "https://github.com/transmission/transmission/releases/download/4.0.4/transmission-4.0.4.tar.xz" \
&& tar -xf transmission4.tar.xz && cd transmission-4.0.4* && mkdir build && cd build \
&& cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. && make && make install \
&& checkinstall -y -D --pkgname transmission --pakdir /var/tmp --pkgversion=${TBT_VERSION}
FROM base
VOLUME /data
VOLUME /config
COPY --from=TransmissionUIs /opt/transmission-ui /opt/transmission-ui
COPY --from=TransmissionBuilder /var/tmp/*.deb /var/tmp/
ARG TBT_VERSION=4.0.4
ARG DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN echo "installing Transmission" && set -x \
&& if [[ ${TBT_VERSION} =~ ^4 ]]; then \
ls -alh /var/tmp/*.deb ;\
debfile=$(compgen -G /var/tmp/transmission_*_$(dpkg --print-architecture).deb); \
if [[ -n ${debfile} ]]; then \
echo "Installing transmission ${TBT_VERSION}" && dpkg -i ${debfile} ;\
else echo "No /var/tmp/transmission_*_$(dpkg --print-architecture).deb found. Exiting" \
; exit ; fi ; \
else echo "Installing transmission from repository" \
&& export TBT_VERSION=3.00 \
&& apt-get install -y --no-install-recommends transmission-daemon transmission-cli; fi
RUN apt-get update && apt-get install -y \
dumb-init openvpn privoxy \
tzdata dnsutils iputils-ping ufw openssh-client git jq curl wget unrar unzip bc \
&& ln -s /usr/local/share/transmission/public_html/images /opt/transmission-ui/transmission-web-control \
&& ln -s /usr/local/share/transmission/public_html/transmission-app.js /opt/transmission-ui/transmission-web-control/transmission-app.js \
&& ln -s /usr/local/share/transmission/public_html/index.html /opt/transmission-ui/transmission-web-control/index.original.html \
&& rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* \
&& groupmod -g 1000 users \
&& useradd -u 911 -U -d /config -s /bin/false abc \
&& usermod -G users abc
# Add configuration and scripts
ADD openvpn/ /etc/openvpn/
ADD transmission/ /etc/transmission/
ADD scripts /etc/scripts/
ADD privoxy/scripts /opt/privoxy/
# Support legacy IPTables commands
RUN update-alternatives --set iptables $(which iptables-legacy) && \
update-alternatives --set ip6tables $(which ip6tables-legacy)
ENV OPENVPN_USERNAME=**None** \
OPENVPN_PASSWORD=**None** \
OPENVPN_PROVIDER=**None** \
OPENVPN_OPTS= \
GLOBAL_APPLY_PERMISSIONS=true \
TRANSMISSION_HOME=/config/transmission-home \
TRANSMISSION_RPC_PORT=9091 \
TRANSMISSION_RPC_USERNAME= \
TRANSMISSION_RPC_PASSWORD= \
TRANSMISSION_DOWNLOAD_DIR=/data/completed \
TRANSMISSION_INCOMPLETE_DIR=/data/incomplete \
TRANSMISSION_WATCH_DIR=/data/watch \
CREATE_TUN_DEVICE=true \
ENABLE_UFW=false \
UFW_ALLOW_GW_NET=false \
UFW_EXTRA_PORTS= \
UFW_DISABLE_IPTABLES_REJECT=false \
PUID= \
PGID= \
PEER_DNS=true \
PEER_DNS_PIN_ROUTES=true \
DROP_DEFAULT_ROUTE= \
WEBPROXY_ENABLED=false \
WEBPROXY_PORT=8118 \
WEBPROXY_USERNAME= \
WEBPROXY_PASSWORD= \
LOG_TO_STDOUT=false \
HEALTH_CHECK_HOST=google.com \
SELFHEAL=false
HEALTHCHECK --interval=1m CMD /etc/scripts/healthcheck.sh
# Pass revision as a build arg, set it as env var
ARG REVISION
ENV REVISION=${REVISION:-""}
# Compatability with https://hub.docker.com/r/willfarrell/autoheal/
LABEL autoheal=true
# Expose ports and run
#Transmission-RPC
EXPOSE 9091
# Privoxy
EXPOSE 8118
CMD ["dumb-init", "/etc/openvpn/start.sh"]