-
Notifications
You must be signed in to change notification settings - Fork 0
/
HOWTO
90 lines (70 loc) · 2.29 KB
/
HOWTO
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
How to build the image:
1: create sample torrc for use TOR inside local network
cat << EOM >> torrc
Log notice stdout
SocksPort 0.0.0.0:9050
EOM
2: create Dockerfile
cat << EOM >> Dockerfile
# Tor 0.3.2.9/0.3.3.2-alpa STABLE & ALPHA
# Docker Image v0.1 20180221
# create your own torrc for your likings, sample torrc available
FROM alpine:latest
LABEL maintainer="bootsektor <https://hub.docker.com/u/bootsektor"
# TESTED ON RASPBERRYY PI 3 ( HOST OS: HypriotOS )
# EXPOSE PORT FOR EXTERNAL USE TORORT, TOR-DNS, TOR-DIRECTORY
EXPOSE 9050 9053 9001
# FETCH AND COPY TOR LATEST STABLE/BETA TO INTO SAME FOLDER
#
# wget https://www.torproject.org/dist/tor-0.3.2.9.tar.gz
# wget https://www.torproject.org/dist/tor-0.3.2.9.tar.gz.asc
# wget https://www.torproject.org/dist/tor-0.3.3.2-alpha.tar.gz
# wget https://www.torproject.org/dist/tor-0.3.3.2-alpha.tar.gz.asc
# COPY PREFERRED VERSION TO YOUR IMAGE
#
COPY tor-0.3.3.2-alpha.tar.gz /tmp/
COPY tor-0.3.3.2-alpha.tar.gz.asc /tmp/
# COPY tor-0.3.2.9.tar.gz /tmp/
# COPY tor-0.3.2.9.tar.gz.asc /tmp/
RUN build_pkgs=" \
openssl-dev \
zlib-dev \
libevent-dev \
gnupg \
build-base \
perl \
"\
&& runtime_pkgs=" \
libgcc \
openssl \
zlib \
libevent \
"\
&& apk --update add ${build_pkgs} ${runtime_pkgs} \
&& cd /tmp/ \
&& gpg --keyserver keys.gnupg.net --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 \
&& gpg --keyserver keys.gnupg.net --recv-keys 4607B1FB \
&& gpg --verify tor*.asc \
&& tar xzf tor*.gz \
&& cd tor-* \
&& ./configure --prefix=/usr \
&& make -j4 \
&& make install-strip \
&& cd \
&& rm -rf /tmp/* \
&& apk del ${build_pkgs} \
&& rm -rf /var/cache/apk/*
RUN adduser -Ds /bin/sh tor
RUN mkdir /etc/tor
COPY torrc /etc/tor/
USER tor
CMD ["tor", "-f", "/etc/tor/torrc"]
EOM
3: build your own image
docker build -t <insert_name_of_your_liking> .
4: fetch some coffee
5: run newly created image and run a shell inside your image:
docker run -it insert_name_of_your_liking /bin/sh
# run tor in your image, expose your TOR for your local network and use it:
docker run -d -p $(hostname -I|awk '{print $1}'):9050:9050 insert_name_of_your_liking
curl -s --socks5 $(hostname -I|awk '{print $1}'):9050 http://whatsmyip.de|grep h3|sed "s/<[^>]*>//g"