Tor service as a docker container, supporting multiple platforms/architectures (armv6, armv7, arm64, amd64)
The work here was initially based on lncm/docker-tor, but has diverged much since.
NOTE: For an always up-to-date list see: https://hub.docker.com/r/lnliz/tor/tags
v0.4.9.15v0.4.9.14v0.4.9.11v0.4.9.5v0.4.8.21Copy the supplied Tor configuration, then run Tor with a private data volume. This publishes the SOCKS port only on the host's loopback address:
cp torrc-dist torrc
docker run --rm -d \
--name tor \
-p 127.0.0.1:9050:9050 \
-v "$PWD/torrc:/etc/tor/torrc:ro" \
-v tor-data:/var/lib/tor \
-v tor-control:/var/run/tor \
lnliz/tor:v0.4.9.15
The supplied Compose file runs Tor on a bridge network and publishes SOCKS only to the host's loopback address. Copy torrc-dist to torrc before starting it.
To connect Bitcoin Core to Tor, put both services on the same Compose network:
services:
tor:
image: lnliz/tor:v0.4.9.15
container_name: tor
volumes:
- ./torrc:/etc/tor/torrc:ro
- tor-data:/var/lib/tor
- tor-control:/var/run/tor
restart: on-failure
stop_grace_period: 10m30s
bitcoind:
image: lnliz/bitcoind:v29.0
volumes:
- ./bitcoin:/.bitcoin
- tor-control:/var/run/tor:ro
group_add:
- "1000"
depends_on:
- tor
volumes:
tor-data:
tor-control:
Set proxy=tor:9050 and torcontrol=tor:9051 in Bitcoin Core's bitcoin.conf. Tor writes the control cookie to /var/run/tor/control_auth_cookie. The shared tor-control volume gives Bitcoin Core read access to that cookie without sharing Tor's data directory. The group ID 1000 matches the image's default Tor group; change it if you build the image with a different UID.
You can mount your own torrc instead of the supplied one:
services:
tor:
image: lnliz/tor:v0.4.9.15
volumes:
- ./host-directory/torrc:/etc/tor/torrc:ro
docker run --rm \
--name tor \
lnliz/tor:v0.4.9.15 \
--hash-password passwordtogenerate
The GitHub Action takes the Tor version from the git tag, then fetches, verifies, and compiles that upstream release from dist.torproject.org.
To grab a new version, tag a new release:
Example:
git tag -s v0.4.9.11+build1
Would release v0.4.9.11 of Tor.
As a maintainer, you should also update the documentation too.
Note In order to trigger builds This repository uses the following environment variables:
DOCKER_HUB_USER - the username for Docker HubDOCKER_USERNAME - The username for Docker Hub.DOCKER_PASSWORD - The password for Docker HubDOCKER_TOKEN - the token for Docker Hub which can push to this project (not used currently)GITHUB_TOKEN - The token of the current user (this is added automatically)GITHUB_ACTOR - The user to log in to docker.pkg.github.comGITHUB_REPOSITORY - The repository pathname (used for the push to GitHub's package registry)Content type
Image
Digest
sha256:798fd0273…
Size
11.8 MB
Last updated
about 1 month ago
docker pull lnliz/tor:v0.4.9.15-arm64v8