首先创建一个Dockerfile
文件:
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"]
还有一个docker-compose.yml
文件:
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
不要忘记将您的settings.json
文件放在配置文件夹(Users/jean/mystuff/config/settings.json)中。并在这个 json 文件中保持一致!用于财产等/transmission/downloads
...download-dir
然后我们必须构建图像(打开终端并转到所在的Dockerfile
位置)
docker build -t transmission .
最后通过做启动(打开终端并转到所在的docker-compose.yml
位置)
docker-compose up -d
非常感谢:https ://gitlab.com/alexhaydock/docker-transmission