-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
55 lines (46 loc) · 1.48 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
FROM rust:bullseye AS tor-builder
LABEL maintainer="lambdhack@lambdhack.bzh"
WORKDIR /tor/
RUN DEBIAN_FRONTEND=noninteractive \
apt update -q \
&& apt install -qy \
--no-install-recommends \
libevent-dev \
libzstd-dev \
openssl \
zlib1g-dev \
wget \
gcc \
libssl-dev \
make \
ca-certificates \
python3 \
&& apt-get clean
ENV TOR_VERSION 0.4.6.7
RUN wget -q https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz \
&& tar xzf tor-${TOR_VERSION}.tar.gz \
&& cd tor-${TOR_VERSION} \
&& ./configure \
--enable-rust \
--enable-cargo-online-mode \
--enable-static-tor \
--enable-static-openssl \
--with-openssl-dir=/usr/lib/x86_64-linux-gnu/ \
--enable-static-libevent \
--with-libevent-dir=/usr/lib/x86_64-linux-gnu/ \
--enable-static-zlib \
--with-zlib-dir=/usr/lib/x86_64-linux-gnu/ \
--disable-asciidoc \
--disable-manpage \
--disable-html-manual \
--disable-system-torrc \
&& make -j $(($(nproc)-1)) \
&& cp src/app/tor /tor/tor \
&& cp src/config/geoip /tor/geoip \
&& cp src/config/geoip6 /tor/geoip6
FROM scratch
LABEL maintainer="lambdhack@lambdhack.bzh"
COPY --from=tor-builder /tor/tor /
COPY --from=tor-builder /tor/geoip /var/lib/tor/
COPY --from=tor-builder /tor/geoip6 /var/lib/tor/
ENTRYPOINT ["/tor", "-f", "/etc/torrc", "--DataDirectory", "/var/lib/tor/keys"]