Skip to content

Relocating the Docker root directory | Docker dir path

Bash
sudo systemctl stop docker
sudo systemctl stop docker.socket
sudo systemctl stop containerd
Bash
sudo mkdir -p /new_dir_structure
Bash
sudo mv /var/lib/docker /new_dir_structure
Bash
sudo vim /etc/docker/daemon.json
JSON
{
  "data-root": "/new_dir_structure/docker"
}
Bash
sudo systemctl start docker
  • check
Bash
docker info -f '{{ .DockerRootDir}}'