Home Docker Updates

I still use Docker at home to run local services, but over time I’ve been making tweaks, moving services around, and upgrading hardware.

What I have now is:

  • A physical fanless “scooter computer“ running Windows Server 2016 with Hyper-V enabled.
  • A single Hyper-V VM Ubuntu Minimal Server running Docker CE.

The fanless machine has cut down the noise levels in my home office, as well as drawing a little less power than the machine I had before.

I changed the Docker host OS from CentOS to Ubuntu, as I had a couple of weird cases where containers would die without explanation on CentOS. I tried Ubuntu and the problem went away. I didn’t bother investigating further.

My docker-compose.yml

This hasn’t changed much since my previous post, but I have now moved Plex to be a container too. Here’s the full compose file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
version: '3'
services:
pihole:
image: diginc/pi-hole:debian
container_name: pihole
ports:
- 192.168.0.11:53:53/tcp
- 192.168.0.11:53:53/udp
- 192.168.0.11:80:80/tcp
cap_add:
- NET_ADMIN
environment:
- DNS1=8.8.8.8
- DNS2=8.8.4.4
- ServerIP=192.168.0.11
- WEBPASSWORD=Not4U2See
restart: always
dhcp:
image: networkboot/dhcpd
container_name: dhcp
volumes:
- /opt/docker/data/dhcp:/data
network_mode: host
restart: always
plex:
image: plexinc/pms-docker
container_name: plex
volumes:
- /opt/docker/data/plex:/config
- /mnt/media:/data
ports:
- 32400:32400/tcp
- 3005:3005/tcp
- 8324:8324/tcp
- 32469:32469/tcp
- 1900:1900/udp
- 32410:32410/udp
- 32412:32412/udp
- 32413:32413/udp
- 32414:32414/udp
environment:
- ADVERTISE_IP="http://192.168.0.10:32400/"
- PLEX_CLAIM=claim-Not4U2See
restart: always
network_mode: "host"
couchpotato:
build:
context: /opt/docker/dockerfiles/couchpotato/
container_name: couchpotato
volumes:
- /opt/docker/data/couchpotato/:/datadir
- /mnt/media/:/media
ports:
- 192.168.0.15:80:5050
environment:
- CP_UID=5000
- CP_GID=5000
restart: always
sickbeard:
build:
context: /opt/docker/dockerfiles/sickbeard/
container_name: sickbeard
volumes:
- /opt/docker/data/sickbeard/:/datadir
- /mnt/media/:/media
ports:
- 192.168.0.16:80:8081
environment:
- SICKBEARD_UID=5000
- SICKBEARD_GID=5000
restart: always
poste:
image: analogic/poste.io
container_name: poste
volumes:
- /etc/localtime:/etc/localtime:ro
- /opt/docker/data/poste/:/data
ports:
- 192.168.0.17:25:25
- 192.168.0.17:80:80
- 192.168.0.17:110:110
- 192.168.0.17:143:143
- 192.168.0.17:443:443
- 192.168.0.17:465:465
- 192.168.0.17:587:587
- 192.168.0.17:993:993
- 192.168.0.17:995:995
restart: always
gogs:
image: gogs/gogs
container_name: gogs
ports:
- 192.168.0.18:22:22/tcp
- 192.168.0.18:80:3000
volumes:
- /opt/docker/data/gogs/:/data
restart: always

Multi Network Adapter Configuration for Ubuntu

The one thing I’m so glad that has been added to Ubuntu is the support for netplan. To make my life easier with opening ports like 443 for multiple containers, I just use multiple IP Addresses, which is easily defined as an array in /etc/netplan/01-netcfg.yml:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses: [192.168.0.10/24,192.168.0.11/24,192.168.0.12/24,192.168.0.13/24,192.168.0.14/24,192.168.0.15/24,192.168.0.16/24,192.168.0.17/24,192.168.0.18/24,192.168.0.19/24]
gateway4: 192.168.0.1
nameservers:
addresses: [192.168.0.3,192.168.0.4]
search: [example.local]

And then applying the changes:

1
sudo netplan apply

And then I can bind containers to those addresses, should they need their own separate IP from the host (very handy for the poste machine).

Updating Containers

Periodically I update my containers by just removing them, pulling down their latest images, and starting them all up again:

1
2
3
4
5
cd /opt/docker/compose/
sudo docker-compose stop
sudo docker-compose rm
sudo docker-compose pull
sudo docker-compose up -d