dockerdocker-composedockerfiletransmissiontransmission-daemon

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 :)


Solution

  • 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