Skip to content

Instantly share code, notes, and snippets.

@ShinChven
Created September 16, 2019 02:32
Show Gist options
  • Save ShinChven/9a974d23da00219c3ea11e673c3480ff to your computer and use it in GitHub Desktop.
Save ShinChven/9a974d23da00219c3ea11e673c3480ff to your computer and use it in GitHub Desktop.
Clean docker host
#!/bin/bash
docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi
#!/bin/bash
docker ps -q -f status=exited | xargs --no-run-if-empty docker rm
#!/bin/bash
docker rmi $(docker images | grep "<none>" | awk "{print $3}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment