mirror of
https://github.com/fphammerle/docker-tor-proxy.git
synced 2025-10-27 02:43:35 +01:00
946bc9db19
https://web.archive.org/web/20211204112320/https://gitweb.torproject.org/tor.git/plain/ChangeLog https://git.alpinelinux.org/aports/commit/community/tor?h=3.15-stable&id=01351ec5162a1c190361b3799c63862a4c94d935 https://git.alpinelinux.org/aports/commit/community/tor?h=3.15-stable&id=7d4f77837c3a2f1cecfbfbe9224552b3614e3664 https://git.alpinelinux.org/aports/commit/community/tor?h=3.15-stable&id=8c36ff0a65aac9960da5cfce6694eedd8d869da6 https://git.alpinelinux.org/aports/commit/community/tor?h=3.15-stable&id=82d7315dd0e5b8d8fca73c175c95c280d24707b1 https://github.com/fphammerle/docker-tor-obfs4-bridge/commit/ebf4ab28c1c9a3b481334feff9826e2f0e2b5cc1 https://web.archive.org/web/20211204163111/https://lwn.net/Articles/866923/ https://web.archive.org/web/20211204162830/https://marc.info/?l=netfilter&m=163724233607275&w=2 https://git.alpinelinux.org/aports/commit/main/nftables?h=3.15-stable&id=e6af0bc07e922da5464d954686ffa1b144147289 https://git.alpinelinux.org/aports/commit/main/nftables?h=3.15-stable&id=bff049102a3177352d3caff2aa4aecf8a2993740 https://git.alpinelinux.org/aports/commit/main/nftables?h=3.15-stable&id=d69dc1a17026ff1844636db10fa77c7b546ac45a
44 lines
1.4 KiB
Docker
44 lines
1.4 KiB
Docker
FROM docker.io/alpine:3.15.0
|
|
|
|
# nftables + dependencies add 2.3MB to image
|
|
ARG TOR_PACKAGE_VERSION=0.4.6.7-r1
|
|
ARG NFTABLES_PACKAGE_VERSION=1.0.1-r0
|
|
RUN apk add --no-cache \
|
|
nftables=$NFTABLES_PACKAGE_VERSION \
|
|
tor=$TOR_PACKAGE_VERSION
|
|
VOLUME /var/lib/tor
|
|
|
|
#RUN apk add --no-cache \
|
|
# less \
|
|
# man-db \
|
|
# strace \
|
|
# tor-doc=$TOR_PACKAGE_VERSION
|
|
#ENV PAGER=less
|
|
|
|
EXPOSE 9050/tcp
|
|
EXPOSE 9053/udp
|
|
COPY torrc.template entrypoint.sh /
|
|
RUN chmod -c a+rX /torrc.template /entrypoint.sh
|
|
ENV SOCKS_TIMEOUT_SECONDS= \
|
|
EXIT_NODES= \
|
|
EXCLUDE_EXIT_NODES=
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
# entrypoint.sh drops privileges after configuring nftables for transparent proxy
|
|
#USER tor
|
|
CMD ["tor", "-f", "/tmp/torrc"]
|
|
|
|
# keeping dns requests as network-liveness is too optimistic
|
|
# https://gitweb.torproject.org/torspec.git/tree/control-spec.txt
|
|
HEALTHCHECK CMD \
|
|
printf "AUTHENTICATE\nGETINFO network-liveness\nQUIT\n" | nc localhost 9051 \
|
|
| grep -q network-liveness=up \
|
|
&& nslookup -port=9053 google.com localhost | grep -v NXDOMAIN | grep -q google \
|
|
|| exit 1
|
|
|
|
# https://github.com/opencontainers/image-spec/blob/v1.0.1/annotations.md
|
|
ARG REVISION=
|
|
LABEL org.opencontainers.image.title="tor socks, dns & transparent proxy" \
|
|
org.opencontainers.image.source="https://github.com/fphammerle/docker-tor-proxy" \
|
|
org.opencontainers.image.revision="$REVISION"
|