Docker and You

  • Guest, it's time once again for the hotly contested and exciting FoH Asshat Tournament!



    Go here and fill out your bracket!
    Who's been the biggest Asshat in the last year? Once again, only you can decide!

a_skeleton_03

<Banned>
29,948
29,762
So I swapped all of my home server applications to docker a little while back and am finally going to write up what I did for those interested in it. It is super easy to work with and so easy to manage long term.

1.) What is docker
2.) File structure
3.) Necessary tools
4.) Config files

Docker

So I am going to give you the basics of what docker is as I understand and use it. There are better sites out there you could get a deeper level of information from if you want to but for the purposes of this thread you will understand the basics of it.

So docker is a framework that allows you to take an application or group of them and expose their data and traffic to the OS but only at a basic level. Think of it like a virtual machine without all the overhead. Everything is contained in the ... container of the docker and docker itself talks to the OS and then back to the container passing just what each side needs. It keeps things really clean when it comes to dependencies that might not be compatible. You remember when you used to have different autoexec.bat files for gaming? It is sort of like that.

There is a little bit of hands off what is in the container and some level of trust with the developer just like any other application. That being said you could build your own so you know exactly what is inside it. I do not but I use trusted containers from known places.


File structure

So I run linux as my server but the beauty of this is you can do this on windows or mac osx as well. You need a place for all of the containers to expose their config files to so you can edit them. You also need to choose how you expose your file structure over to the containers. One of the benefits is you can expose only certain folders and also map new folder names to the container.

I have all of my config files in /opt/docker/ and then a folder for each container. I have all of my exposed files in /library/ and it's mostly media so folders like /library/movies /library/tv etc etc


Necessary Tools

Personally I only use docker compose and docker but there are a ton of tools for automation and web interfaces. Instead of using nginx or some other webserver in a docker that is something I run as part of the OS. If you are not running linux then it would be quite useful to run the webserver in docker for ease of use.

Get Docker CE for Ubuntu
Install Docker for Windows
Get started with Docker for Mac

Those are the official install instructions from docker and it's pretty easy to get running. Once you get that up and running that is all you actually need. For Docker Compose you only need to do something to install it on linux because it's default installed for windows/mac osx.

Install Docker Compose

Compose is super awesome because it allows you to create a yml file that lists all your dockers and what they have access to and you can bring them all down and up within seconds. This allows me to spin up an entirely new server in about 5 minutes max. Copy the docker compose file, download the backup of the containers config folders, install docker, install compose, tell it to run the compose file, and done.

Here is my compose file.

YAML:
--- 
version: '2'
services:
 plex:
  image: linuxserver/plex:latest
  container_name: plex
  volumes:
    - /opt/plex:/config
    - /library:/data
  network_mode: host
  restart: always
  environment:
    - CLAIM="PJVO7UTP3YPJVCQJUYPJ"
    - VERSION=latest
    - PUID=1000
    - PGID=1000
    - TZ=America\New_York
 
 emby:
  image: emby/embyserver:latest
  container_name: emby
  volumes:
    - /opt/emby:/config
    - /library:/data
  ports:
    - 8000:8096
  restart: always
  environment:
    - APP_UID=1000
    - APP_GID=1000
    - TZ=America\New_York

 tautulli:
  image: shiggins8/tautulli
  container_name: tautulli
  depends_on:
    - plex
  volumes:
    - /opt/plexpy:/config
    - /opt/plexpy/logs:/logs:ro
  ports:
    - 8181:8181
  links:
    - plex
  restart: always
  environment:
    - PUID=1000
    - PGID=1000
 
 sonarr:
  image: linuxserver/sonarr
  container_name: sonarr
  volumes:
    - /opt/sonarr:/config
    - /library/tv:/tv
    - /home/a_skeleton_03/Downloads:/downloads
  ports:
    - 8989:8989
  links:
    - jackett
  restart: always
  environment:
    - PUID=1000
    - PGID=1000
    
 radarr:
  image: linuxserver/radarr
  container_name: radarr
  volumes:
    - /opt/radarr:/config
    - /library/movies:/movies
    - /home/a_skeleton_03/Downloads:/downloads
  ports:
    - 7878:7878
  links:
    - jackett
  environment:
    - PUID=1000
    - PGID=1000
  restart: always

 jackett:
  image: linuxserver/jackett
  container_name: jackett
  volumes:
    - /opt/jackett/config:/config
    - /opt/jackett/downloads:/downloads
  ports:
    - 9117:9117
  environment:
    - PUID=1000
    - PGID=1000
    - TZ=America\New_York
  restart: always

 calibre:
  image: linuxserver/calibre-web
  container_name: calibre
  ports:
    - 8083:8083
  volumes:
    - /opt/calibre/config:/config
    - /library/books:/books
  environment:
    - PUID=1000
    - PGID=1000
    - TZ=America\New_York
  restart: always

 ombi:
  image: linuxserver/ombi
  container_name: ombi
  ports: 
    - 3579:3579
  volumes:
    - /opt/ombi:/config
    - /etc/localtime:/etc/localtime:ro
  environment:
    - PUID=1000
    - PGID=1000
    - TZ=America\New_York
  restart: always

 influxdb:
  image: influxdb:latest
  container_name: influxdb
  ports:
    - 8085:8083
    - 8086:8086
    - 8090:8090
  volumes:
    - /opt/influxdb:/var/lib/influxdb
  env_file:
    - env.influx
  restart: always

 telegraf:
  image: telegraf:latest
  container_name: telegraf
  links:
    - influxdb
  volumes:
    - /opt/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
    - /var/run/docker.sock:/var/run/docker.sock:ro
  environment:
    - PUID=1000
    - PGID=1000
    - TZ=America\New_York
  restart: always

 grafana:
  image: grafana/grafana:latest
  container_name: grafana
  ports:
    - 3000:3000
  links:
    - influxdb
  env_file: 
    - env.grafana
  restart: always

 rutorrent:
  image: linuxserver/rutorrent
  container_name: rutorrent
  ports:
    - 8087:80
    - 5000:5000
    - 51413:51413
    - 6881:6881
  volumes:
    - /opt/rutorrent:/config
    - /home/a_skeleton_03/Downloads:/downloads
  environment: 
    - PUID=1000 
    - PGID=1000 
    - TZ=America\New_York
  restart: always

 gazee:
  image: hubcapps/docker-gazee
  container_name: gazee
  ports:
    - 4242:4242
  volumes:
    - /library/comics:/comics
    - /opt/gazee:/config
  environment:
    - PUID=1000
    - PGID=1000
    - TZ=America\New_York
  restart: always
 
  • 6Like
Reactions: 5 users

ZyyzYzzy

RIP USA
<Banned>
25,295
48,789
And here I thought docker was a noun to describe an individual who partakes in docking.
 
  • 1Worf
Reactions: 1 user

Denamian

Night Janitor
<Nazi Janitors>
7,116
18,728
Cool. I will look in to this when I have the time, probably in the middle of next week. All I'm doing right now is running a plex server and I just plan on adding a couple pluigins (plex requests and Tautili). I have no idea at this time if I'm going to run anything else on it.
 

Void

Experiencer
<Gold Donor>
9,374
10,987
Hopefully I get some time and reasons to check this out soon. My server has basically turned into nothing but a Plex server just like Denamian's. The people that use mine are mostly too retarded to use something like Plex Requests even (although I've never actually used it myself either). If they want something they just text me, that's about the extent of my automation.

Oh, and I never sent it off to a data center either, I got permission to set it up at work and use our internet there. It is nowhere near as fast as what I'd get at a data center, but it is free, and most everyone I share with only uses it at night anyway so it doesn't conflict with work. And honestly no one here even understands what it does, I told them it was a Minecraft server. I still use a Whatbox for my torrents because it is just so easy and cheap-ish.
 
  • 1Like
Reactions: 1 user

loudgas

Golden Baronet of the Realm
3,777
18,800
As I have mentioned in other threads I'm currently running Xpenology with Docker. I have never played with docker before so I'm still trying to get my Windows brain wrapped around it.

Having some challenges getting Observium working in docker, this is the zuhkov/observium variant. I have tried typing in the terminal window of docker but doesn't seem to respond to any commands, any tricks to getting it to play nice?

edit:minor update, found I could enable ssh on Xpenology/Synology and I can connect and see IP info etc. Still not sure of next steps, ie whether to create a new network and assign to my local subnet range. Docker still seems to employ network isolation so I'm not sure if creating a new network will get me any further ahead.
 
Last edited:
  • 1Like
Reactions: 1 user

loudgas

Golden Baronet of the Realm
3,777
18,800
Can you do route commands in linux/docker like you can with Windows?
 

Deathwing

<Bronze Donator>
16,315
7,313
We use Docker at work as basically an end-around on our IT department. Partly because DFARS has turned them into cock-blockers. And partly because VMWare 6.5 can go fuck itself.

As long as you don't need to test some esoteric platform and/or hardware, Docker is better at spinning up a new test machine than traditional virtual machines are.