Its size is 20G and it contains tons of hash like 00074a74d6cf2052eeb6a9e61bd2b407b464bce6a23a4596ce2e9100f58b6de6
.
What is this "diff" folder for?
AUFS cannot use the following backing filesystems: aufs, btrfs, or ecryptfs. This means that the filesystem which contains /var/lib/docker/aufs cannot be one of these filesystem types. If the AUFS driver is loaded into the kernel when you start Docker, and no other storage driver is configured, Docker uses it by default.
A diff in Docker terms is simply the difference in filesystem. Like git, it takes an initial read only image and builds the final container by layering your diffs. Everytime you do something in the container it creates a change in the layer which may be commited to a new image via docker commit.
In terms of what the aufs/diff directory contains: AUFS is a union filesystem, which means that it layers multiple directories on a single Linux host and presents them as a single directory. These directories are called branches in AUFS terminology, and layers in Docker terminology.
layers/: metadata about how image layers are stacked. This directory contains one file for each image or container layer on the Docker host. Each file contains the IDs of all the layers below it in the stack (its parents).
Docker works as a union file system or ufs. A diff in Docker terms is simply the difference in filesystem. Like git, it takes an initial read only image and builds the final container by layering your diffs. Everytime you do something in the container it creates a change in the layer which may be commited to a new image via docker commit. If you know what youre doing you can delete those diffs and clean out your disk space.
Likely there's been many changes or large files committed to those layered or diff file systems.
This will clean out your system. Be careful, it could delete something you might want.
docker system prune
First off, you don't want to interact with files in /var/lib/docker
, those are only meant to be interacted with by Docker.
In terms of what the aufs/diff
directory contains:
AUFS is a union filesystem, which means that it layers multiple directories on a single Linux host and presents them as a single directory. These directories are called branches in AUFS terminology, and layers in Docker terminology. The unification process is referred to a a union mount.
diff
specifically contains:
the contents of each layer, each stored in a separate subdirectory
However, this changes if the container is running, in which case it contains:
Differences introduced in the writable container layer, such as new or modified files.
Source: https://docs.docker.com/storage/storagedriver/aufs-driver/#how-the-aufs-storage-driver-works
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With