Skip to content

Instantly share code, notes, and snippets.

@ngpestelos
Last active October 8, 2025 18:58
Show Gist options
  • Select an option

  • Save ngpestelos/4fc2e31e19f86b9cf10b to your computer and use it in GitHub Desktop.

Select an option

Save ngpestelos/4fc2e31e19f86b9cf10b to your computer and use it in GitHub Desktop.
How to remove unused Docker containers and images

May 8, 2018

I wrote this four years ago, so instead use this command:

$ docker rmi $(docker images -q -f dangling=true)
@Kejk23
Copy link

Kejk23 commented Jul 31, 2022

docker ps -a -q | % { docker rm $_ }
docker images -q | % { docker rmi $_ }

thank you so much

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