Sign inSign up

aricodes/tor

By aricodes

•Updated almost 3 years ago

The latest version of tor in a slim image, and nothing else added.

Image
0

850

aricodes/tor repository overview

⁠tor-docker

Build Status

Github source⁠

Regular builds of the most up-to-date stable version of Tor from source, with a slim alpine-based image and no out-of-the-box assumptions on what you want running in your container.

⁠Usage

If you just want the default tor service configuration running, just start the container and you're done!

If you want to customize the config, read on...

⁠Customizing torrc

You can mount your own torrc file at /etc/torrc, using whatever configuration options suit your usecase best. Sometimes though, this isn't sufficient, and that's where you can programmatically generate your config:

⁠Custom torrc example

docker run -v $PWD/torrc:/etc/torrc aricodes/tor:latest

⁠Startup scripts

If you're using this image to host your own hidden service inside of docker-compose or docker-swarm, you'll need to be able to dynamically find the IP of the container running your app in order to update your config file. You could do so with a shell script:

export TARGET_ADDR=$(nslookup container_name_here | grep Address | head -n2 | tail -n1 | cut -d' ' -f2)

And then by dropping that into your torrc config file -

echo "HiddenServiceDir /var/lib/tor/my_service/" >> /etc/torrc
echo "HiddenServicePort 80 $TARGET_ADDR:80" >> /etc/torrc

but you would need to run that on startup. Simply mount your script as a volume into the /scripts folder and then entrypoint will run them before starting the tor service itself!

⁠Startup scripts example

docker run -v $PWD/generate-my-config.sh:/scripts/generate-my-config.sh aricodes/tor:latest

Tag summary

Content type

Image

Digest

sha256:be6651b80…

Size

13.6 MB

Last updated

over 3 years ago

docker pull aricodes/tor