-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
82 lines (74 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
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
FROM alpine:3.21.2
# Build-time variables
ARG TOR_VERSION=0.4.8.13
ARG TZ=Europe/Berlin
WORKDIR /tmp
RUN \
set -o xtrace && \
apk update && \
apk add \
curl \
gettext \
libcap \
libevent \
su-exec \
xz-libs \
zlib \
zstd-libs && \
apk add --virtual build \
build-base \
ca-certificates \
gnupg \
gnupg-keyboxd \
libcap-dev \
libevent-dev \
openssl-dev \
xz-dev \
zlib-dev \
zstd-dev && \
\
CURL_OPTIONS="--no-progress-meter --fail --location --remote-name" && \
curl ${CURL_OPTIONS} "https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz" && \
curl ${CURL_OPTIONS} "https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz.sha256sum" && \
curl ${CURL_OPTIONS} "https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz.sha256sum.asc" && \
gpg --auto-key-locate nodefault,wkd --locate-keys [email protected] \
[email protected] && \
sha256sum -c "tor-${TOR_VERSION}.tar.gz.sha256sum" && \
gpg --verify "tor-${TOR_VERSION}.tar.gz.sha256sum.asc" && \
tar -zxf "tor-${TOR_VERSION}.tar.gz" && \
\
cd tor-${TOR_VERSION} && \
./configure \
--sysconfdir=/etc \
--localstatedir=/var \
--prefix=/usr \
--disable-gcc-warnings-advisory \
--disable-asciidoc \
--disable-html-manual \
--disable-manpage \
--enable-lzma \
--enable-zstd \
--silent && \
\
CFLAGS=-Wno-cpp make && \
\
make test && \
\
make install && \
\
apk del build && \
rm -rf /tmp/* && \
rm -rf /var/cache/apk/* && \
\
addgroup -S tor && \
adduser -s /bin/false -SDH -G tor tor
VOLUME /data
WORKDIR /data
COPY torrc-defaults-source /etc/tor/
COPY config.sh /config.sh
COPY entry-point.sh /entrypoint.sh
COPY healthcheck.sh /healthcheck.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["tor", "-f", "/data/torrc"]
HEALTHCHECK --timeout=5s CMD /healthcheck.sh