Skip to content

Instantly share code, notes, and snippets.

@flavianmissi
Created February 24, 2022 14:07
Show Gist options
  • Save flavianmissi/5d262bc9c168c25f15a5778feafae3d1 to your computer and use it in GitHub Desktop.
Save flavianmissi/5d262bc9c168c25f15a5778feafae3d1 to your computer and use it in GitHub Desktop.
delete container images matching grep pattern
PATTERN=localhost
# run the cmd below to see what you'll delete
# docker images --format '{{.ID}} {{.Repository}}' | grep ${PATTERN}
docker rmi $(docker images --format '{{.ID}} {{.Repository}}' | grep ${PATTERN} | awk '{print $1}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment