OS: Ubuntu 24.04
Docker 27.2.1
I am using docker compose.
My configuration works fine until the system reboots. Following a reboot, I have to issue:
$ docker start
when I do that, everything works fine. But I have to issue that manually.
$ docker inspect NAS_PlexData
[
{
"CreatedAt": "2024-09-13T10:53:21-05:00",
"Driver": "local",
"Labels": {
"com.docker.compose.project": "dockerconfig",
"com.docker.compose.version": "2.29.2",
"com.docker.compose.volume": "NAS_PlexData"
},
"Mountpoint": "/var/lib/docker/volumes/NAS_PlexData/_data",
"Name": "NAS_PlexData",
"Options": {
"device": ":/PlexData",
"o": "addr=192.168.x.y,nfsvers=4.1,rw",
"type": "nfs"
},
"Scope": "local"
}
]
The service immediately after a reboot:
$ docker inspect sonarr
[
{
"Id": "c797d0e1a9fbf766513dd9bd3a166786c7bf5d81bcf2e1fbc56eea28f0c25a34",
"Created": "2024-09-13T15:53:21.4682294Z",
"Path": "/init",
"Args": [],
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 128,
"Error": "error while mounting volume '/var/lib/docker/volumes/NAS_PlexData/_data': failed to mount local volume: mount :/PlexData:/var/lib/docker/volumes/NAS_PlexData/_data, data: addr=192.168.2.15,nfsvers=4.1: no route to host",
"StartedAt": "2024-09-13T16:43:23.345249681Z",
"FinishedAt": "2024-09-13T16:46:52.586093821Z"
},
It appears to me that the issue is a timing during the boot process. So I tried modifying the boot sequence by modifying /lib/systemd/system/docker.service to add an after clause:
After=network-online.target docker.socket firewalld.service containerd.service time-set.target multi-user.target
#After=network-online.target docker.socket firewalld.service containerd.service time-set.target nfs-client.target systemd-resolved.service NetworkManager-wait-online.service nss-lookup.target
I listed the current one and a commented out prior attempt. Neither were successful. I tried adding multi-user.target as it has the last start time of any target on my system. Since my docker containers only need to be available after the system boots (nothing else uses them) I felt being the last service to start would be OK.
I have tired using both FQDN and IP address, neither made a difference.
$ cat compose.yml
services:
sonarr:
image: lscr.io/linuxserver/sonarr:latest
container_name: sonarr
environment:
- PUID=1000
- PGID=1000
- TZ=US/Central
volumes:
- /mnt/MediaRaid/DockerConfig/config_sonarr:/config
- NAS_PlexData:/NAS_MediaContent
ports:
- 8989:8989
restart: unless-stopped
# restart: on-failure:3
radarr:
image: lscr.io/linuxserver/radarr:latest
container_name: radarr
environment:
- PUID=1000
- PGID=1000
- TZ=US/Central
volumes:
- /mnt/MediaRaid/DockerConfig/config_radarr:/config
- NAS_PlexData:/NAS_MediaContent
ports:
- 7878:7878
# restart: on-failure:3
restart: unless-stopped
volumes:
NAS_PlexData:
driver: local
name: NAS_PlexData
driver_opts:
type: nfs
o: addr=192.168.x.y,nfsvers=4.1,rw
# o: addr=NAS.mylocal,nfsvers=4.1,rw
device: :/PlexData