Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
147 views
in Technique[技术] by (71.8m points)

How to install Transmission using Docker

I am completely new in Docker. I want to install Transmission using Docker (i.e. I don't want to use linuxserver.io/transmission)

For the moment my Dockerfile is :

RUN apt-get update -y
RUN apt-get install transmission-daemon -y
EXPOSE 9091 51413/tcp 51413/udp

But how to give the settings.json file? How to run my Dockerfile? Do I need a docker-compose.yml file?

Thank you in advance :)

question from:https://stackoverflow.com/questions/65939681/how-to-install-transmission-using-docker

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...