How can I safely reinstall Docker without removing volumes?

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?

  • How do I configure boot2docker to start my containers on boot?
  • docker rabbitmq hostname issue
  • Docker virtual network interfaces are mandatory
  • Run a docker image on Windows results in “oci runtime error: exec: ”bash“: executable file not found in $PATH.”
  • Docker push on OS/X very slow - and seems to push layers that have already been pushed
  • How to make sure docker's time syncs with that of the host?
  • What's the best approach to schedule tasks across docker cluster?
  • How to fake cpu architecture in docker container?
  • Do I need a reverse proxy if I'm running a Node.js in a Docker container?
  • Faster Google App Engine Managed VM deploys (Python compat env)?
  • pam limits in docker containers aren't working
  • not able to build a specific Dockerfile
  • 2 Solutions collect form web for “How can I safely reinstall Docker without removing 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

    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.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.