How to move the Docker Root Directory
During the installation of a vFunction Server on a Linux VM, the script checks to make sure there is at least 5gb of free space in the default Docker root directory, /var/lib/docker/ for the vFunction Container images.
Take the following steps to move the default Docker root directory if the disk space on the VM exists in another location.
In this example /app/docker is used as the new default Docker root directory. Replace this directory with your actual location in the steps below.
- Run
sudo systemctl stop docker
- Run
sudo systemctl stop docker.socket
- Run
sudo systemctl stop containerd
- Run
mkdir -p /app/docker/
- Run
sudo mv /var/lib/docker /app/docker/
- Run
vi /etc/docker/daemon.json
- Add these lines to this file:
{
"data-root": "/app/docker/docker"
}
- Run
sudo systemctl start docker
- Run
docker info -f '{{ .DockerRootDir}}'
to confirm the new Docker root location