When I try to override the config file using a volume mount, I get an error running the container:
Nov 05 21:50:06.750 [notice] Tor 0.4.1.6 running on Linux with Libevent 2.1.10-stable, OpenSSL 1.1.1c, Zlib 1.2.11, Liblzma N/A, and Libzstd N/A.
Nov 05 21:50:06.750 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Nov 05 21:50:06.751 [notice] Read configuration file "/etc/tor/torrc.config".
Nov 05 21:50:06.755 [notice] Opening OR listener on 0.0.0.0:9001
Nov 05 21:50:06.755 [notice] Opened OR listener on 0.0.0.0:9001
Nov 05 21:50:06.755 [notice] Opening Directory listener on 0.0.0.0:9030
Nov 05 21:50:06.755 [notice] Opened Directory listener on 0.0.0.0:9030
Nov 05 21:50:06.755 [warn] Error creating directory /var/lib/tor/.tor: Permission denied
Nov 05 21:50:06.755 [warn] Failed to parse/validate config: Couldn't create private data directory "/var/lib/tor/.tor"
Nov 05 21:50:06.755 [err] Reading config failed--see warnings above.
version: "3.7"
services:
torrelay:
container_name: torrelay
hostname: torrelay
restart: always
image: chris579/tor-alpine
volumes:
- /etc/localtime:/etc/localtime:ro
- /data/tor/data:/var/lib/tor
- /data/tor/config/torrc.config:/etc/tor/torrc.config
ports:
- 9001:9001
- 9030:9030
Obviously it's some permission issue, but I can't seem to figure out what's wrong. I haven't volume mapped the whole /var/lib/tor
directory, so I was assuming it shouldn't be an issue in that regard, but then I don't get this issue when I'm not overriding the config through a volume map.
environment:
- PUID=${PUID}
- PGID=${PGID}
- /data/tor/config:/etc/tor