Skip to content

Instantly share code, notes, and snippets.

@st3b1t
Last active July 15, 2023 10:28
Show Gist options
  • Save st3b1t/5c933edb99308ef32bf87ae786eeab33 to your computer and use it in GitHub Desktop.
Save st3b1t/5c933edb99308ef32bf87ae786eeab33 to your computer and use it in GitHub Desktop.
Tor Node Dockerfile
FROM debian:stable-slim
ARG PUB_CONTROLIP=0.0.0.0
ARG PUB_CONTROLPORT=9052
#ACCESSLOG /var/log/rinetd.log
RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retires=10 install --no-install-recommends -y \
ca-certificates curl gnupg && \
printf 'deb http://deb.torproject.org/torproject.org stable main' >> /etc/apt/sources.list && \
curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | apt-key add - && \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retires=10 install --no-install-recommends -y \
rinetd \
tor && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN chown debian-tor /etc/tor/torrc
RUN printf '\nSocksPort 0.0.0.0:9050\nControlPort 9051\n' >> /etc/tor/torrc
RUN printf '$PUB_CONTROLIP\t$PUB_CONTROLPORT\t127.0.0.1\t9051\n' >> /etc/rinetd.conf
USER debian-tor
CMD /usr/sbin/rinetd && /usr/bin/tor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment