Docker of Transmission-daemon
Backgroud
Here we use the Dockerfile to directly generate the Docker image locally.
In the open source world, such a theory that the less installed software is, the more secure it is. Although it is not entirely correct, it is still true in most environments.
Based on the above theory, we will not choose a larger Debian / Ubuntu Docker image (80 + MB), and instead use a small alpine image (4MB).
The files for this article have been posted on Github-haven200.
Using hub-docker mirrors
Chinese users, in order to improve the pull speed of Docker base image, here we use Azure image service.
1 | :~$ cat > /etc/docker/daemon.json <<EOF |
Dockerfile
1 | FROM alpine:latest |
- FROM:creates a layer from the alpine:latest Docker image.。
- MAINTAINER:Maintainer of the image.
- WORKDIR:The current directory of the system in the docker image. You should always use absolute paths for your
WORKDIR
. Also, you should useWORKDIR
instead of proliferating instructions likeRUN cd … && do-something
, which are hard to read, troubleshoot, and maintain. - RUN:builds your application with
make
. - COPY:adds files from your Docker client’s current directory.
- EXPOSE:The
EXPOSE
instruction indicates the ports on which a container listens for connections. - VOLUME:This instruction should be used to expose any database storage area, configuration storage, or files/folders created by your docker container.
- CMD: specifies what command to run within the container.
- HEALTHCHECK:Tell the platform how to test that us application is healthy,
run.sh
Transmission configuration options are all in this file, and you can modify it yourself before compiling.
1 |
|
Build the Docker image
Run the following command in the Dockerfile
directory
1 | docker build -t haven200/transmission-daemon . |
Run Image
1 | docker run -d --name transmission-daemon \ |
Set username and password
1 | docker run -d --name transmission-daemon \ |
USERNAME
: Login UsernamePASSWORD
: Login Password
References:
- Install Docker-CE
- Docker
- Github-haven200