diff --git a/Docker-container-on-Ubuntu-16.04-LTS.md b/Docker-container-on-Ubuntu-16.04-LTS.md new file mode 100644 index 0000000..86966de --- /dev/null +++ b/Docker-container-on-Ubuntu-16.04-LTS.md @@ -0,0 +1,82 @@ +# Installing docker + +Let's start by installing docker from the Docker repository. Execute the following commands: + +``` +sudo apt -y install linux-image-extra-virtual +sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list +sudo apt update && sudo apt -y install docker-engine +``` + +# Create systemd service file + +`sudo nano /etc/systemd/system/docker-radarr.service` + +Copy/Paste the following into nano: + +``` +[Unit] +Description=Radarr container +Requires=docker.service +After=docker.service + +[Service] +Restart=always +RestartSec=30 +ExecStart=/usr/bin/docker run --rm --name radarr -p 7878:7878 -e PUID=1000 -e PGID=1000 -e TZ= -v //radarr/config:/config -v //radarr/downloads:/downloads -v //movies:/movies linuxserver/radarr +ExecStop=/usr/bin/docker stop radarr + +[Install] +WantedBy=multi-user.target +``` + +Enable the service on boot and start it: + +``` +sudo systemctl enable docker-radarr +sudo systemctl start docker-radarr +``` + +The first time you'll start the container it can take a while because it will need to download the docker image. + +Let's check if it's running: + +`sudo systemctl status docker-radarr` + +Output should be like this if it's running OK: + +``` +● docker-radarr.service - Radarr container + Loaded: loaded (/etc/systemd/system/docker-radarr.service; enabled; vendor preset: enabled) + Active: active (running) since ma 2017-01-16 00:29:57 CET; 14h ago + Main PID: 9946 (docker) + Tasks: 7 + Memory: 3.7M + CPU: 46ms + CGroup: /system.slice/docker-radarr.service + └─9946 /usr/bin/docker run --rm --name radarr -p 7878:7878 -e PUID=1000 -e PGID=1000 -e TZ= -v ... + +jan 16 00:30:01 server docker[9946]: ------------------------------------- +jan 16 00:30:01 server docker[9946]: User uid: 1000 +jan 16 00:30:01 server docker[9946]: User gid: 1000 +jan 16 00:30:01 server docker[9946]: ------------------------------------- +jan 16 00:30:01 server docker[9946]: [cont-init.d] 10-adduser: exited 0. +jan 16 00:30:01 server docker[9946]: [cont-init.d] 30-config: executing... +jan 16 00:30:01 server docker[9946]: [cont-init.d] 30-config: exited 0. +jan 16 00:30:01 server docker[9946]: [cont-init.d] done. +jan 16 00:30:01 server docker[9946]: [services.d] starting services +jan 16 00:30:01 server docker[9946]: [services.d] done. +``` + +If you like to stop the container: + +`sudo systemctl stop docker-radarr` + +# Updating the docker image + +Execute the following commands: + +``` +sudo docker pull linuxserver/radarr +sudo systemctl restart docker-radarr +```