# start container, attach stdin, use psuedo tty, use host network
docker run -it --network=host ubuntu:16.04
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images**
docker rmi $(docker images -q --filter "dangling=true")
# Remove all unused containers, networks, images
docker system prune
# Restart unhealthy containers
docker restart $(docker ps -q --filter "health=unhealthy")
# if apt-get install doesn't work, it may not be a network issue re: https://github.com/moby/moby/issues/866#issuecomment-19218300
# try the following:
apt-get update
apt-get install net-tools
-q == --quiet # return ids only
-t # pseudo tty (interactive shell)
-i # bind stdin