Skip to content

Instantly share code, notes, and snippets.

@obazoud
Last active September 27, 2022 04:56
Show Gist options
  • Save obazoud/6413369 to your computer and use it in GitHub Desktop.
Save obazoud/6413369 to your computer and use it in GitHub Desktop.
Remove docker image without tag
#!/bin/bash
sudo docker stop $(docker ps -a -q)
sudo docker rm $(docker ps -a -q)
sudo docker ps -a | grep 'months ago' | awk '{print $1}' | xargs sudo docker rm
sudo docker images | grep "\<none\>" | awk '{ print $3 }' | xargs sudo docker rmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment