Create Docker image from Tor source based on debian:stable-slim image.
I've searched a way to run a to middle-guard relay in Docker.
Thanks to Jannis Seeman for this great course in Docker Docker komplett: Vom Anfänger zum Profi (inkl. Kubernetes).
- TORVER: tor source version
- CompilerThreads: CPU threads to use for compiling during build process. Set this to max CPU cores or threads.
- EXPOSEPORT: Port that is exposed to host.
Please set User ID and Group ID to match existing account in host system for exchange date via volume.
UNAME="debian-tor"
UID="1000"
GID="1000"
Please see torrc.sample file for detailed explanation.
Nickname="nickname"
ContactInfo="Random Person <nobody AT example dot com>"
RelayBandwidthRate="100 KB"
RelayBandwidthBurst="200 KB"
ORPortAdv="4431"
ORPortListen="${EXPOSEPORT}"
ExitRelay="0"
SocksPort="0"
Log="notice stderr"
docker build --tag debtor .
docker container create --name debtor -e UID=1031 -e GID=100 -v ${PWD}\usr_local_etc_tor\:/usr/local/etc/tor/ -p 4431:9050 --restart always debtor
docker container start debtor