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
11 Answer
To revert to your original setup (and thus returning to Docker installed as a snap), I would recommend the following procedure:
Stop your 2 new containers (using
docker stop <container ID>)Remove the
aptversion of Docker (using:sudo apt remove docker.io)Make sure you can now see your 2 original containers (
docker ps).You could restart your 2 new containers with the original parameters, data etc. using the
snapversion 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