rootless docker - containers do not start after a power cut but starts again when host reboot

Viewed 136

I have debian 10.5 host with docker running in rootless mode (followed this guide : https://docs.docker.com/engine/security/rootless/)

When there is a power cut (I don't have a UPS), my debian 10.5 VM starts automatically when power is restored. Everything works fine except my docker daemon. There's no error with the service:

systemctl --user status docker
● docker.service - Docker Application Container Engine (Rootless)
   Loaded: loaded (/home/dockerprod/.config/systemd/user/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2022-01-08 12:04:40 +04; 4min 43s ago
     Docs: https://docs.docker.com
 Main PID: 770 (rootlesskit)
   CGroup: /user.slice/user-1001.slice/user@1001.service/docker.service
           ├─770 rootlesskit --net=vpnkit --mtu=1500 --slirp4netns-sandbox=auto --slirp4netns-seccomp=auto --disable-host-loopback --port-driver=builtin --copy-up=/etc --copy-up=/run /
           ├─805 /proc/self/exe --net=vpnkit --mtu=1500 --slirp4netns-sandbox=auto --slirp4netns-seccomp=auto --disable-host-loopback --port-driver=builtin --copy-up=/etc --copy-up=/ru
           ├─816 vpnkit --ethernet /tmp/rootlesskit308973386/vpnkit-ethernet.sock --mtu 1500 --host-ip 0.0.0.0
           ├─896 dockerd --experimental --storage-driver=vfs
           └─936 containerd --config /run/user/1001/docker/containerd/containerd.toml --log-level info

But the containers did not start for some reason. I am not sure what logs to look at.

sudo journalctl -u docker.service

returns nothing

If I restart the host, the containers start as normal. So I always need to restart the host after a power cut which is not ideal when I am not at home.

Any idea what to look at?

Maybe a clue; my docker lib folder (where containers and images are stored) is on another HDD mounted automatically in /etc/fstab Maybe after a power cut upon reboot, docker daemon is started before the HDD on which the docker lib folder is mounted? Does not know if this makes sense.

edit: I moved the mounting command in /etc/fstab of HDD on which the docker lib is on to the top. Does not solve the issue. Another note, /lib/docker/containers/ is empty after the power cut If I restart the host, /lib/docker/containers/ contains the containers again..

0 Answers
Related