I have a problem with my docker environment since I recently restarted my system.
I have the following setup:
Installed Version: Docker version 23.0.1, build a5ee5b1
OS: Ubuntu 22.04.2 LTS running as LXC container in Proxmox
After an update of Proxmox and a restart of my host and the dockerhost-LXC, docker is not starting/listing my previous containers anymore:
docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
docker images -a
REPOSITORY TAG IMAGE ID CREATED SIZE
âdocker volume lsâ does list my volumes however.
Looking into the filesystem in /var/lib/docker I see the folders of my containers in /var/lib/containers. For some reason the docker daemon does not find them.
The structure in each folder looks like this:
I would put my money on âthe determined default storage driver changedâ.
Containers and images are bound to a storage driver when pulled/created. If the storage driver changes, it will look like existing images and containers are gone. Though, what really happens is that the changed storage driver isnât able to work with existing images and containers from the previous storage driver.
You can check the storage driver the container uses like this:
Furthermore, you want to check the currently used storage driver:
docker info --format '{{.Driver}}'
Please share the output of both commands, plus the output of cat /etc/docker/deamon.json. Chances are high, the file does not even exist. All commands should be run as root.
With this three information, we can recommend how to approach further. Just setting the storage-driver to the old one might look like a quick win, but it might not be the best option.
Seems like you had the right guess here, though I wonder how that happened.
The config.v2.json says vfs, while âdocker infoâ returns âoverlay2â
My bad, it should have been /etc/docker/daemon.json. If it doesnât exist, you can create it.
Seems the overlay2 support wasnât there earlier. It is definitely the storage driver you want to go with, as itâs the most performant and efficient storage driver. Vfs on the other hand is everything but efficient (=wastâs a lot of space), is slower and according the docs not recommended for productive systems.
Personally, I would switch back to vfs to clean all images and containers, and start over with the overlay2 storage driver. Neither images nor containers are worth being backed up, as you can pull or build an image again, and can easily create containers again. Volumes on the other hand would be wort to be backed up, but they are not affected by teh storage driver â you can use them as they areâŠ
You can switch back the storage driver according this Use the VFS storage driver | Docker Docs. Once you made your cleanup, I highly recommend switching to overlay2 permanently.