Run TOR conveniently from a docker scratch container.
$ docker run --rm --network host boeboe/tor-scratch
Once the docker container has finished starting, you can test it with the following command:
$ curl --socks5 localhost:9050 --socks5-hostname localhost:9050 https://check.torproject.org/api/ip
NOTE: If you use do not use host network, you need to force tor to listen on
0.0.0.0
instead of the default127.0.0.1
In order to pass a torrc
configuration file and modify the exposed proxy port:
$ cat torrc
Log notice stdout
SocksPort 0.0.0.0:9050
MaxCircuitDirtiness 30
$ docker run -p 8080:9050 -v "$(pwd)"/torrc:/torrc boeboe/tor-scratch tor -f torrc
$ curl --socks5 localhost:8080 --socks5-hostname localhost:8080 https://check.torproject.org/api/ip
Please use this link (GitHub account required) to suggest a change in this image configuration.