Pages

Tuesday, 31 October 2023

Be careful of docker's VFS storage driver!

Today after host OS patching, docker daemon for some reason cannot start. So, I just removed /var/lib/docker and restarted it.

Suddenly, strange things heppened.

docker pull became super slow, and the consumed HUGE disk space to save the images. E.g an image around 1.6GB would occupy more than 30GB disk space.

1 Root cause

The root cause is for unknow reasons, docker started using "VFS" storage driver. This storage driver hard copy everything, is compeletly not an Union FS at all.

$ docker info | grep Storage
 Storage Driver: vfs

2 Solution

To solve this problem, explicitly config the storage driver to use by editing /etc/docker/daemon.json.

{
    "storage-driver": "overlay2"
}

3 Other

Docker Storage Driver document at https://docs.docker.com/storage/storagedriver/vfs-driver/





No comments:

Post a Comment