I am trying to move the default Docker storage (/var/lib/docker)to a different location.
I have an XFS formated drive mounted at /home/data. The /etc/docker/daemon.json
contains:
{
"log-level": "warn",
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "5"
}
}
{
"storage-driver": "overlay2"
}
{
"data-root": "/home/data/"
}
After stopping the docker and containerd services, /var/lib/docker is moved to /home/data and docker is started. /var/lib/docker is recreated and running:
docker info -f ‘{{ .DockerRootDir}}’ shows /var/lib/docker.
What have I missed.