forked from antitree/private-tor-network
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
78 lines (67 loc) · 2.27 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
#
# Dockerfile for the Private Tor Network
#
# This is a dockerfile to build a Debian host and
# compile a version of tor from the Tor apt repos.
# NOTE: This is a modification of chriswayg's solid
# base.
#
# Usage:
# This works best using a docker compose command so you can run the
# necessary other servers for it to talk to. But if you want o run
# manually:
#
# docker run --rm -it -e ROLE=DA antitree/tor-server /bin/bash
FROM debian:jessie
MAINTAINER Antitree antitree@protonmail.com
# Sets which version of tor to use. See the Tor Projects git page for available tags
# Examples:
# * tor-0.2.8.4-rc
# * tor-0.2.7.6
# * tor-0.2.7.5
# * release-0.2.1
ENV TOR_VER="release-0.3.1"
#ENV TOR_VER="master"
# NOTE sometimes the master branch doesn't compile so I'm sticking with the release
# feel free to change this to master to get the latest and greatest
# Sets the nickname if you didn't set one, default ports, and the path
# where to mount the key material used by the clients.
ENV TERM=xterm \
TOR_ORPORT=7000 \
TOR_DIRPORT=9030 \
TOR_DIR=/tor
# Install build dependencies
RUN apt-get update && \
build_temps="build-essential automake" && \
build_deps="libssl-dev zlib1g-dev libevent-dev ca-certificates\
dh-apparmor libseccomp-dev dh-systemd \
git" && \
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install $build_deps $build_temps \
init-system-helpers \
pwgen && \
mkdir /src && \
cd /src && \
git clone https://git.torproject.org/tor.git && \
cd tor && \
git checkout ${TOR_VER} && \
./autogen.sh && \
./configure --disable-asciidoc && \
make && \
make install && \
apt-get -y purge --auto-remove $build_temps && \
apt-get clean && rm -r /var/lib/apt/lists/* && \
rm -rf /src/*
# Copy the base tor configuration file
COPY ./config/torrc* /etc/tor/
# Copy docker-entrypoint and the fingerprint script
COPY ./scripts/ /usr/local/bin/
# Persist data (Usually don't want this)
#VOLUME /etc/tor /var/lib/tor
# Create the shared directory
RUN mkdir ${TOR_DIR}
# ORPort, DirPort, ObfsproxyPort
# TODO make these match the env variables
# TODO is this necessary anymore?
EXPOSE 9001 9030 9051
ENTRYPOINT ["docker-entrypoint"]
CMD ["tor", "-f", "/etc/tor/torrc"]