By default docker on linux uses /var/lib/docker as its data directory (in docker parlance, "data-root"). This can be inconvenient for those of us whose /var is located on a boot drive with only a modest amount of space. After installing docker I always relocate its data directory to a bigger volume. Assuming that volume is named "data1", here's the procedure:
- Shut down docker and containerd,
systemctl stop docker; systemctl stop containerd
. - Create a /etc/docker/daemon.json file with the following contents:
{
"data-root": "/data1/docker"
}