forked from sugarchain-project/esplora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.tor
29 lines (20 loc) · 1.08 KB
/
Dockerfile.tor
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
FROM alpine@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d AS builder
ARG TOR_VER=0.4.2.6
ARG TORGZ=https://dist.torproject.org/tor-$TOR_VER.tar.gz
RUN apk --no-cache add --update \
alpine-sdk gnupg libevent libevent-dev zlib zlib-dev openssl openssl-dev
RUN wget $TORGZ.asc && wget $TORGZ
# Verify tar signature and install tor
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys 0x6AFEE6D49E92B601 \
&& gpg --verify tor-$TOR_VER.tar.gz.asc || { echo "Couldn't verify sig"; exit; }
RUN tar xfz tor-$TOR_VER.tar.gz && cd tor-$TOR_VER \
&& ./configure && make install
FROM alpine@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
RUN apk --no-cache add --update \
bash alpine-sdk gnupg libevent libevent-dev zlib zlib-dev openssl openssl-dev
RUN adduser -s /bin/bash -D -u 2000 tor
RUN mkdir -p /var/run/tor && chown -R tor:tor /var/run/tor && chmod 2700 /var/run/tor
RUN mkdir -p /home/tor/tor && chown -R tor:tor /home/tor/tor && chmod 2700 /home/tor/tor
COPY ./torrc /home/tor/tor/torrc
COPY --from=builder /usr/local/ /usr/local/
USER tor