Skip to content

Instantly share code, notes, and snippets.

@damnit
Created October 8, 2015 10:56
Show Gist options
  • Save damnit/37ae83a79a8e9eb65235 to your computer and use it in GitHub Desktop.
Save damnit/37ae83a79a8e9eb65235 to your computer and use it in GitHub Desktop.

Revisions

  1. damnit created this gist Oct 8, 2015.
    5 changes: 5 additions & 0 deletions docker-rmutil.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    #!/bin/bash
    # delete all containers matching a $1
    docker ps -a | grep $1 | awk '{print $1}' | xargs docker rm
    # delete all "<none>" image-pollution by docker-compose
    docker images | grep \<none\> | awk '{print $3}' | xargs sudo docker rmi