From a47c0dd6da1629c1fc8c253a37ef7ad58a03092d Mon Sep 17 00:00:00 2001 From: Donald Webster Date: Tue, 7 Mar 2017 12:58:06 -0800 Subject: [PATCH] Updated Docker (markdown) --- Docker.md | 46 ++++++++++++++-------------------------------- 1 file changed, 14 insertions(+), 32 deletions(-) diff --git a/Docker.md b/Docker.md index ac90dde..cbcf66d 100644 --- a/Docker.md +++ b/Docker.md @@ -1,25 +1,18 @@ -# Installing Docker +## Installing Docker * [Get Started with Docker for Windows](https://docs.docker.com/docker-for-windows/) * [Get Docker for Ubuntu](https://docs.docker.com/engine/installation/linux/ubuntu/) * [Get Docker for Fedora](https://docs.docker.com/engine/installation/linux/fedora/) * [Install Docker on Arch Linux](https://docs.docker.com/engine/installation/linux/archlinux/) * [Docker on FreeBSD](https://wiki.freebsd.org/Docker) -# Pick Release or Nightly +## Pick Release or Nightly * Release: [linuxserver/radarr](https://hub.docker.com/r/linuxserver/radarr/) * Nightly: [hotio/radarr](https://hub.docker.com/r/hotio/radarr/) Follow the directions on their site to get everything setup and working. -# Create systemd service file - -```bash -sudo nano /etc/systemd/system/docker-radarr.service -``` - -Copy/Paste the following into nano and change `` + `` accordingly: - -See [this link](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for timezones. +# Using systemd +Using your favorite editor, create `/etc/systemd/system/docker-radarr.service` with the following systemd unit file. Be sure to replace `TIMEZONE` and `LOCALPATH` with the correct values. ```systemd [Unit] @@ -28,7 +21,7 @@ Requires=docker.service After=docker.service [Service] -Restart=always +Restart=on-failure RestartSec=30 ExecStart=/usr/bin/docker run --rm \ @@ -36,7 +29,7 @@ ExecStart=/usr/bin/docker run --rm \ --network host \ -e PUID=1000 \ -e PGID=1000 \ - -e TZ= \ + -e TZ= \ -v //config:/config \ -v //downloads:/downloads \ -v //movies:/movies \ @@ -48,34 +41,22 @@ ExecStop=/usr/bin/docker stop radarr WantedBy=multi-user.target ``` -Save the file using keyboard combo Ctrl+o, exit with Ctrl+x and set permissions using the command: - +##Set permissions ```bash sudo chmod 644 /etc/systemd/system/docker-radarr.service ``` -Enable the service on boot and start it: +## Enable and Start ```bash 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. If you want to prevent this you can do a pull first with: - -```bash -sudo docker pull linuxserver/radarr -``` - -Let's check if it's running: +## Check Status: ```bash sudo systemctl status docker-radarr -``` - -Output should be like this if it's running OK: - -```bash ● 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 @@ -98,15 +79,15 @@ jan 16 00:30:01 server docker[9946]: [services.d] starting services jan 16 00:30:01 server docker[9946]: [services.d] done. ``` -Try going to [http://your-ip-address:7878](http://your-ip-address:7878) in your browser. +Try going to in your browser. -If you like to stop the container: +## Stopping ```bash sudo systemctl stop docker-radarr ``` -# Updating the docker image +## Update Docker Image Execute the following commands: @@ -115,6 +96,7 @@ sudo docker pull linuxserver/radarr sudo systemctl restart docker-radarr ``` +## Automate Docker Image Update If you want to automate this, you can use the following script (let it run with a systemd timer): ```bash @@ -136,7 +118,7 @@ done Modify the variables `images`, `containers` and `services` according to your system. This script will only restart a service/container if the docker image was updated by `docker pull`. -# Doing some cleanup +## Cleanup With these commands you can do some cleanup of docker images and containers: