Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
$ docker network ls
$ docker network ls | grep "bridge"
$ docker network rm $(docker network ls | grep "bridge" | awk '/ / { print $1 }')
// see: http://stackoverflow.com/questions/32723111/how-to-remove-old-and-unused-docker-images
$ docker images
$ docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
$ docker images | grep "none"
$ docker rmi $(docker images | grep "none" | awk '/ / { print $3 }')
// see: http://stackoverflow.com/questions/32723111/how-to-remove-old-and-unused-docker-images
$ docker ps
$ docker ps -a
$ docker rm $(docker ps -qa --no-trunc --filter "status=exited")
$ docker-machine create --driver virtualbox --virtualbox-disk-size "40000" default
I use tutum/lamp image docker. ( 500 Mo )
Then, i update upgrade in the shell
Then, i add php curl
I save the image, i have a file with 750Mo.
Then, i import this file.
update upgrade and clean
I save this, and, the new image is fat ( 950 Mo )
How i can clean my file and have a good size ( 500 / 600 mo ? )
More Docker command in French : https://www.visionduweb.eu/wiki/index.php?title=Ajouter_Docker_sur_GNU_Linux