Skip to content

Instantly share code, notes, and snippets.

@farrellit
Created December 29, 2017 22:55
Show Gist options
  • Save farrellit/3b4d43933c86620a74ad1f30636d540e to your computer and use it in GitHub Desktop.
Save farrellit/3b4d43933c86620a74ad1f30636d540e to your computer and use it in GitHub Desktop.
docker cleanup
# remove containers which have exited
docker ps -a | awk '/Exited[ ]\(/ {print $1}' | xargs docker rm
# remove images without tag nor repo
docker images | awk '/^<none>[[:space:]]*<none>/ {print $3}' | xargs docker rmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment