-2

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

dejanualex
  • 3,872
  • 6
  • 22
  • 37
LetsGoBrandon
  • 498
  • 8
  • 23
  • This question is a bit broad right now: there are lots of resources out there that walk through the process of containerizing an application. – larsks Jan 28 '21 at 15:10
  • I did not find any ressource installing from scratch. (Yes there is but it always uses the unofficial method of https://hub.docker.com/r/linuxserver/transmission which I don't want to use!) – LetsGoBrandon Jan 28 '21 at 17:37
  • 1
    Just out of curiosity, how come you don't want to use the LinuxServer container? Their containers are top notch, I use a ton of them. If it's because you want to use your own `settings.json` file with it you can just mount it on container startup so those settings are used. – J. Scott Elblein Jan 28 '21 at 18:50
  • @J.ScottElblein Don't know, I thought it was yet another stupid developer with great influence that I have to trust XD and, most important, I am really interested to learn how to do it myself :) – LetsGoBrandon Jan 28 '21 at 21:01
  • 1
    Ahh ok, for learning i can see it. As far as their quality though no worries, they're Grade A. In fact whenever i go looking for a container i haven't used yet I always look to see if LinuxServer has it first (and I'm usually disappointed when there isn't one, lol). – J. Scott Elblein Jan 28 '21 at 21:21

1 Answers1

5

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

JeanDujardin
  • 162
  • 1
  • 10