Use this to run a Tor proxy (and/or hidden services) in a Docker container.
This repository contains the Dockerfile of Tor for running a TOR client in a docker container.
I based my image on the Debian 8 Jessie image.
- Create a folder containing your torrc file used by Tor. Make sure you're using absolute filepaths to make sure Tor will always be able to parse your configs.
- Run it doing: `docker run -p 127.0.0.1:9050:9050 -v /path/to/your/configuration/directory:/tor -d platzhalter/tor
- Place your hidden service configuration in the same folder as your
- If you don't have those, nevermind, just let Tor generate them automatically.
- Create a new network by doing
docker network create --subnet=172.20.0.0/24
- (Of course you can use any subnet you want to use. Just make sure it's not used by anything else to avoid collision.)
- From now on, you need to use the
--net tor --ip 172.20.0.100flags when starting the Tor container.
- Also, you need to configure all of your hidden services to use the same net by using the
--net tor --ip 172.20.0.<somenumber>flags when starting them.
- You don't need to expose their ports if you want them to be accessible via Tor only!
After that, configure your
HiddenServiceDir /tor/<servicename> HiddenServivePort <port> 172.20.0.<number>:<port> HiddenServicePort ........
- You need at least Docker version 1.10.1 to assign static ip addresses to the machine.
Docker Pull Command