mirror of
https://github.com/fphammerle/docker-tor-proxy.git
synced 2025-10-27 02:43:35 +01:00
874bd0a05d
https://web.archive.org/web/20230512065949/https://git.alpinelinux.org/aports/commit/community/tor?h=3.18-stable&id=baae09009c531905af2a640f10b079334f7d8d66 https://web.archive.org/web/*/https://www.netfilter.org/projects/nftables/files/changes-nftables-1.0.6.txt https://web.archive.org/web/*/https://www.netfilter.org/projects/nftables/files/changes-nftables-1.0.7.txt https://web.archive.org/web/20230512125138/https://git.alpinelinux.org/aports/commit/main/nftables?h=3.18-stable&id=d4c8c0e1ea373d3758a3b31d21648ab2208ccf6c https://web.archive.org/web/20230512125152/https://git.alpinelinux.org/aports/commit/main/nftables?h=3.18-stable&id=eec4537b93faa78be0fe298050a69267b3b245e5 https://web.archive.org/web/20230512125214/https://git.alpinelinux.org/aports/commit/main/nftables?h=3.18-stable&id=fe3c3df8e5866f6df7dd80a15c83b3840df7eac7 https://web.archive.org/web/20230512125239/https://git.alpinelinux.org/aports/commit/main/nftables?h=3.18-stable&id=84a227baf001b6e0208e3352b294e4d7a40e93de https://web.archive.org/web/20230512125256/https://git.alpinelinux.org/aports/commit/main/nftables?h=3.18-stable&id=33626f4a3f04fd4739d1ed14f036cd90dd867686 https://github.com/fphammerle/docker-onion-service/commit/1cfcdfb9bce644b500047f0b201768cdc48c63d5
45 lines
1.4 KiB
Docker
45 lines
1.4 KiB
Docker
FROM docker.io/alpine:3.18.0
|
|
|
|
# nftables + dependencies add 2.3MB to image
|
|
ARG TOR_PACKAGE_VERSION=0.4.7.13-r2
|
|
ARG NFTABLES_PACKAGE_VERSION=1.0.7-r2
|
|
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= \
|
|
SAFE_SOCKS=0 \
|
|
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"
|