-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (47 loc) · 1.86 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
# Base docker image
FROM debian:stable-slim
LABEL maintainer="[email protected] <[email protected]>"
# Install dependencies to add Tor's repository.
RUN \
. /etc/os-release &&\
apt-get update &&\
apt-get install -y \
curl \
gpg \
gpg-agent \
ca-certificates \
libcap2-bin \
--no-install-recommends &&\
# See: <https://2019.www.torproject.org/docs/debian.html.en>
curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import &&\
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add - &&\
printf "deb https://deb.torproject.org/torproject.org ${VERSION_CODENAME} main\n" >> /etc/apt/sources.list.d/tor.list &&\
printf "Package: *\nPin: release a=<release>-backports\nPin-Priority: 500\n" > /etc/apt/preferences &&\
echo "deb https://deb.debian.org/debian ${VERSION_CODENAME}-backports main" > /etc/apt/sources.list.d/backports.list &&\
apt-get update &&\
apt-get install -y \
tor \
tor-geoipdb \
obfs4proxy/${VERSION_CODENAME} \
--no-install-recommends &&\
#apt-get dist-upgrade -qyf &&\
echo "**** cleanup ****" && \
apt-get clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/* &&\
# Allow obfs4proxy to bind to ports < 1024.
setcap cap_net_bind_service=+ep /usr/bin/obfs4proxy &&\
# Our torrc is generated at run-time by the script start-tor.sh.
rm /etc/tor/torrc &&\
chown debian-tor:debian-tor /etc/tor &&\
chown debian-tor:debian-tor /var/log/tor &&\
echo "install completed" &&\
dpkg -s tor | grep '^Version:'
COPY start-tor.sh /usr/local/bin
RUN chmod 0755 /usr/local/bin/start-tor.sh
COPY get-bridge-line /usr/local/bin
RUN chmod 0755 /usr/local/bin/get-bridge-line
USER debian-tor
CMD [ "/usr/local/bin/start-tor.sh" ]