Skip to content

Instantly share code, notes, and snippets.

@paddy74
Created January 27, 2020 20:30
Show Gist options
  • Save paddy74/48ecf3ec857a2b9e81eff412e9a938eb to your computer and use it in GitHub Desktop.
Save paddy74/48ecf3ec857a2b9e81eff412e9a938eb to your computer and use it in GitHub Desktop.
Clean the Docker environment
#!/bin/bash
docker rm -v $(docker ps -a -q -f status=exited)
docker rmi $(docker images -f "dangling=true" -q)
if [[$1 == "-vfs" ]]; then
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment