If you have no free space on your system drive, you can move docker data directory to enother drive

  1. Stop docker daemon

sudo service docker stop

  1. Move your data to enother drive

sudo mv /var/lib/docker /mnt/data/docker

  1. Setup docker daemon config:

sudo vim /etc/docker/daemon.json

# /etc/docker/daemon.json

{
        "data-root": "/mnt/data/docker"
}

save file by pressing Esc and typing :wq and pressing Enter

  1. Start docker daemon

sudo service docker start

  1. Check your images and containers

sudo docker images

sudo docker ps -a

That's it! Have fun!

Add a comment

Next Post Previous Post