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

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

1

1 Answer

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.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like