miércoles, 22 de mayo de 2019

Clean out your Docker images, containers and volumes

Cleaning up containers
Kill all running containers
> docker kill $(docker ps -q)
Delete all stopped containers
> docker rm $(docker ps -a -q)
Cleaning up images
Delete an image
> docker rmi <image name>
Delete all 'untagged/dangling' images
> docker rmi $(docker images -q -f dangling=true)
Delete all images
> docker rmi $(docker images -q)
Cleaning up volumnes
Once a volume is not longer associated with a container, it is considered 'dangling'
> docker volume rm $(docker volume ls -f dangling=true -q)

No hay comentarios.:

Publicar un comentario