Categories
Docker

How to remove unused containers, images and volumes from docker

Remove with system tool (volumes are not removed):

# docker system prune -f --all

Or remove manually:

# docker container rm $(docker container ls -aq) -f

# docker volume rm $(docker volume ls -q)

# docker rmi $(docker images -a -q) -f