-
Notifications
You must be signed in to change notification settings - Fork 400
/
Dockerfile.tor
28 lines (19 loc) · 1.07 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
FROM alpine@sha256:e15947432b813e8ffa90165da919953e2ce850bef511a0ad1287d7cb86de84b5 AS builder
ARG TOR_VER=0.4.6.8
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 keys.openpgp.org --recv-keys 0x6AFEE6D49E92B601 \
&& gpg --verify tor-$TOR_VER.tar.gz.asc || { echo "Couldn't verify sig"; exit 1; }
RUN tar xfz tor-$TOR_VER.tar.gz && cd tor-$TOR_VER \
&& ./configure && make -j $(nproc --all) install
FROM alpine@sha256:e15947432b813e8ffa90165da919953e2ce850bef511a0ad1287d7cb86de84b5
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 --from=builder /usr/local/ /usr/local/
USER tor