Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I safely reinstall Docker without removing volumes?

Tags:

docker

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?

like image 339
Brett Jackson Avatar asked Mar 28 '17 02:03

Brett Jackson


People also ask

Will uninstalling docker remove images?

2 Answers. All the data is in /var/lib/docker . However, this data will not be removed when uninstalling the packages.

How do I clean my docker?

To clean this up, you can use the docker container prune command. By default, you are prompted to continue. To bypass the prompt, use the -f or --force flag. Other filtering expressions are available.


1 Answers

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.

like image 196
Brett Jackson Avatar answered Sep 19 '22 23:09

Brett Jackson