Score:1

I lost access to some Docker containers (snap/apt mix problem)

tr flag

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

tr flag
I have no particular needs, so I would like remove the "snap docker" and add the two old snap containers to "apt docker"
Score:0
vn flag

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.

tr flag
I cant stop the two snap containers properly, because I don't have the ID. The command "docker" currently ignore the old containers...
Artur Meinild avatar
vn flag
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.
tr flag
SOLVED! Thanks a lot!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.