Install Docker Engine on Debian
after install finished.
add user into docker
sudo usermod -aG docker $USER
sudo reboot now
#after re-login
docker ps
you'll get some infomation
How to move docker images to home/other partition
If you are running out of system space, you might need to consider moving your docker images to the /home partition.
Exit all your containers, stop and ‘remove’ (close them)
docker ps
docker container stop xxxx
docker container rm xxx
Now stop the docker service
sudo /etc/init.d/docker stop
Backup your docker images before proceeding so you can recover if something goes wrong.
sudo tar -zcC /var/lib docker > ~/var_lib_docker-backup-$(date +%s).tar.gz
Move your images
sudo mv /var/lib/docker ~/docker
Create / Edit the daemon config (don’t worry if your file is empty)
sudo vim /etc/docker/daemon.json
Add “data-root” to your existing or new (daemon.json) file:
https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file
{
“data-root”: “/home/xxx/docker”
}
Restart docker
sudo /etc/init.d/docker start
How to move docker’s default /var/lib/docker to another directory on Ubuntu/Debian Linux