浏览代码

Add Dockerfile and configuration files for Tor

Add Dockerfile to build a container running Tor as SOCKS proxy that
tunnels requests through the Tor network.

https://www.torproject.org/
Agus Lopez 1 年之前
当前提交
ef23b074d0
共有 2 个文件被更改,包括 20 次插入0 次删除
  1. 17 0
      Dockerfile
  2. 3 0
      torrc

+ 17 - 0
Dockerfile

@@ -0,0 +1,17 @@
+ARG BASE_IMAGE=library/alpine:latest
+
+FROM docker.io/${BASE_IMAGE}
+
+RUN \
+  apk add --update --no-cache tor curl \
+  && rm -rf /var/cache/apk/*
+
+COPY torrc /etc/tor/torrc
+
+EXPOSE 9050/tcp
+
+HEALTHCHECK --interval=5m --timeout=5s \
+  CMD timeout 2 curl -sfo /dev/null --socks5-hostname 127.0.0.1:9050 'https://check.torproject.org'
+
+ENTRYPOINT ["/usr/bin/tor"]
+CMD ["-f", "/etc/tor/torrc"]

+ 3 - 0
torrc

@@ -0,0 +1,3 @@
+Log notice stderr
+DataDirectory /var/lib/tor
+SOCKSPort 0.0.0.0:9050