How to completely reset Docker?

NethServer Version: 7.8.2003
Module: Docker
How does one completely remove docker and reset it? I’ve tried the following:

yum remove nethserver-docker
yum remove docker-ce
rm -r -f /var/lib/docker

And still, when I re-install docker through the software center the Portainer has a record of the 5 containers that existed previously. I can’t get a fresh docker instance to work because the previous container configurations were no longer valid, so they were blocking docker from starting.

@djx

Hi

I don’t personally use Docker in NethServer (It’s elsewhere), but it may be worth checking the e-smith DB…

/var/lib/nethserver/db

if something is stored there… (And remove it…)
It may be under docker or configuration…

My 2 cents
Andy

Container are stored under /var/lib/docker IIRC

But once docker installed

docker rm -f $(docker ps)

Or

docker rm -f containerName

1 Like

Hum, docker service is up if portainer is up, strange

Portainer is just another container

1 Like

I tried this, but the docker command failed to do anything because the docker service was failing to start…

But it’s clear that some configuration is being kept somewhere, because my Portainer admin password has been unchanged through a couple uninstall and re-installs of docker, and through clearing out the whole /var/lib/docker folder

Looking under the /etc/e-smith/events/nethserver-docker-update/S95nethserver-docker-create-portainer file I can see there is storage here: /var/lib/nethserver/portainer.

This seemed to do it. So for me, the steps to remove and reset Docker (and Portainer) are as follows:

yum remove nethserver-docker
yum remove docker-ce
rm -r -f /var/lib/docker
rm -r -f /var/lib/nethserver/portainer

Warning! This will delete all of your containers, and Portainer configuration.

Re-installing through the Software Center worked. Portainer asked me to set up the admin account and everything started running fine.

1 Like