Skip to content

Instantly share code, notes, and snippets.

@jkremser
Last active June 29, 2017 21:32
Show Gist options
  • Save jkremser/2c830e9103d22a5502da745b4ac1bb37 to your computer and use it in GitHub Desktop.
Save jkremser/2c830e9103d22a5502da745b4ac1bb37 to your computer and use it in GitHub Desktop.
alias d=docker
d kill `d ps -aq`
d rm -f `d ps -aq`
d rmi -f `d images -qa`
d volume rm `d volume ls -q`
d network rm `d network ls -q`
# removing images that can't be removed ("Error response from daemon: reference does not exist")
sudo rm -Rf /var/lib/docker/image/devicemapper/imagedb/content/sha256 && sudo mkdir /var/lib/docker/image/devicemapper/imagedb/content/sha256
# this helps if it's saying the port is already allocated even though it's not
sudo rm /var/lib/docker/network/files/*
sudo systemctl restart docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment