First create a Dockerfile
file :
FROM alpine:3
RUN apk --no-cache add transmission-daemon
&& mkdir -p /transmission/config
&& chmod -R 1777 /transmission
&& rm -rf /tmp/*
STOPSIGNAL SIGTERM
ENTRYPOINT ["/usr/bin/transmission-daemon", "--foreground", "--config-dir", "/transmission/config"]
And a docker-compose.yml
file :
version: '3.8'
services:
transmission:
image: transmission
container_name: transmission-container
ports:
- "9091:9091/tcp"
- "51413:51413/tcp"
- "51413:51413/udp"
tmpfs:
- /tmp
volumes:
- /Users/jean/mystuff/config:/transmission/config
- /Users/jean/mystuff/downloads:/transmission/downloads
- /Users/jean/mystuff/incomplete:/transmission/incomplete
restart: unless-stopped
Don't forget to put your settings.json
file in the config folder (Users/jean/mystuff/config/settings.json). And stay consistent in this json file! Use /transmission/downloads
for download-dir
property and so on...
Then we have to build the image (open Terminal and go where the Dockerfile
is located)
docker build -t transmission .
And finally start up, by doing (open Terminal and go where the docker-compose.yml
is located)
docker-compose up -d
Many thanks to : https://gitlab.com/alexhaydock/docker-transmission
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…