I want to run onionshare-cli in a docker container on a Raspberry Pi it requires Tor to be installed - the debian package (apt get tor) is out of date, and the Torproject doesn't provide for the Pi.

So, I have built tor from the source (on github) as per How can I install Tor from the source code in the Git repository?

This provides a 'make install' to install the software on the machine it was built on, but I just want the minimum install of the code into my onionshare docker container.

Now I have all the files on the 'real' Pi and a Dockerfile ready to make the container -- how do I know which files I have to copy and where in the docker image?

The 'make install -d' (to see what it does) produces masses of output(!) and I guess copies more than I need just to get a minimal install.

edit I am happy with docker containers the main reason I mention them in the Q is to emphasize that that I just want a basic functional install of TOR because it is for a light weight 'appliance'. Even if I build and install in a container, what can I then delete?

1 Answer 1


First of all, this isn't so much a Tor question as it is a Docker question, but I'll try to help you out.

Secondly, this has already been done a bunch of times. Check out hub.docker.com to see how other people do what you're asking. I particularly like this Dockerfile because it does everything very simply.

Finally, here is how I create images for the first time. On your raspberry pi, run docker run -it debian bash Replace "debian" with your distro of choice. After you run this, you will create a new container and you will be in that container as root. Follow the directions for building tor here and note where the make install put everything.

Run the history command and save the output someplace and then type exit.

In your Dockerfile, use the commands that you used to build inside the container that you saved from history. Again, look at the link above for an example on how that works. This should be the best way to get started building your own Dockerfile since you're new.

If you need help optimizing your Dockerfile, then post on StackOverflow since this isn't the place for Docker help.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .