Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Last active November 7, 2023 09:02
Show Gist options
  • Save zulhfreelancer/925ef2b16a50bb3b00abeb47d81bc0eb to your computer and use it in GitHub Desktop.
Save zulhfreelancer/925ef2b16a50bb3b00abeb47d81bc0eb to your computer and use it in GitHub Desktop.
How to delete Docker images that contains a sub-string inside the name?

docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'imagename')

For example, to delete all images that contains zulh inside the name, run:

docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'zulh')

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