Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nelsestu/1ea77b637fc3762cc2bf7fbd5d49dd38 to your computer and use it in GitHub Desktop.
Save nelsestu/1ea77b637fc3762cc2bf7fbd5d49dd38 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