1

On my Ubuntu system I made a mistake. I had Docker installed as a snaps package, and two containers running.

Days after, I inadvertently installed Docker as an apt package.... and added two more containers to the system.

In conclusion now I have 4 containers on my system (I'm sure they are all running currently). The command docker container ls shows me only the last two... I don't know how to manage the first two containers (stop them, restart them, etc).

The final goal would obviously be to "clean" the system. But as first goal it would be enough for me to have access to the old containers.

I tried with snap run docker container ls but I still see only the last two containers

Thanks for any info/help

####################

Thanks to the comments below I solved the problem. Thanks a lot! This is approximately what I did as suggested:

  • sudo apt remove docker
  • sudo snap save
  • sudo snap check-snapshot 2
  • sudo snap remove docker
  • sudo snap install docker
  • sudo snap restore 2
  • docker container ls -a

Now I can see my fist to containers :-)

and it is time to to reorganize my PC

gmapp
  • 13
  • 3
  • I have no particular needs, so I would like remove the "snap docker" and add the two old snap containers to "apt docker" – gmapp Feb 04 '22 at 11:05

1 Answers1

0

To revert to your original setup (and thus returning to Docker installed as a snap), I would recommend the following procedure:

  1. Stop your 2 new containers (using docker stop <container ID>)

  2. Remove the apt version of Docker (using: sudo apt remove docker.io)

  3. Make sure you can now see your 2 original containers (docker ps).

  4. You could restart your 2 new containers with the original parameters, data etc. using the snap version of docker (docker run etc ...)

Please let me know if the above works, or if you run into other issues migrating to a clean snap version of Docker.

Also see this Q&A about a similar issue.

Artur Meinild
  • 26,018
  • I cant stop the two snap containers properly, because I don't have the ID. The command "docker" currently ignore the old containers... – gmapp Feb 04 '22 at 11:07
  • You first have to stop the 2 new containers, and then remove the apt version. Under all circumstances, you need to bring your system to a state where only 1 Docker version is installed ASAP. – Artur Meinild Feb 04 '22 at 11:12
  • SOLVED! Thanks a lot! – gmapp Feb 04 '22 at 14:20