I have an issue with my docker installation in which DNS resolution is not working within my containers. How can I safely reinstall docker on Ubuntu 16.04 without removing existing volumes?
It turns out that when uninstalling docker using apt, the /var/lib/docker directory remains untouched, and the volumes will stay intact.
You can simply run apt-get remove docker-ce to uninstall docker without removing your volumes.
Before getting so drastic, try this reset tip:
pkill docker
iptables -t nat -F
ifconfig docker0 down
brctl delbr docker0
docker -d
It will force docker to recreate the bridge and reinit all the network rules