Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove all (untagged) images and containers from Docker
@reporter123

This comment has been minimized.

Copy link

@reporter123 reporter123 commented Dec 29, 2017

docker system prune will remove dangling images, stopped containers, unused networks and build cache.

@dalmosantos

This comment has been minimized.

Copy link

@dalmosantos dalmosantos commented Apr 6, 2021

docker container stop $(docker container ps -q)
docker container rm $(docker container ps -aq)
docker image rm $(docker image ls -fq dangling=true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment