Skip to content

Instantly share code, notes, and snippets.

@tuffacton
Last active February 21, 2020 01:26
Show Gist options
  • Select an option

  • Save tuffacton/a4a41f18305491f6d7dac3b68f00bac2 to your computer and use it in GitHub Desktop.

Select an option

Save tuffacton/a4a41f18305491f6d7dac3b68f00bac2 to your computer and use it in GitHub Desktop.
Remove all docker images that follow a certain pattern.
#!/bin/bash
pattern = $0
docker images -a | grep "$pattern" | awk '{print $3}' | xargs docker rmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment