I've been having a frustrating issue where the containers I create in Portainer just seem to vanish! When I run the command 'docker ps' or 'docker ps -a', nothing shows up, even after I switch contexts. However, Portainer still shows these containers as connected to networks. I even uninstalled the Portainer extension, but those ghost containers remain accessible through their bound ports. The only workaround I've found is to restart the Docker engine. What's going on here? I don't have a second Docker installation or access to the 'snap' command, and I'm managing everything through Docker Desktop. Any advice?
2 Answers
Sounds like you're running Docker Desktop on Linux, right? There's a chance that it’s creating a VM that runs its own version of Docker, which is why your main Docker installation can’t see those containers. Make sure you're installing it correctly according to the Docker docs to avoid these issues.
Could be! I also noted that Windows Server 2022, with WSL running, could complicate things. It's strange that the Docker Desktop on Windows still responds through WSL. Did the OP check for Docker versions through both environments?
You might want to check if you accidentally installed a snap version at some point. That could lead to multiple instances running. Also, regarding the disappearing container you created via Hub, it might not have initialized properly in Portainer at that time, which could explain the weird behavior.
Yeah, I think the title might have been misleading since the issue persisted even after removing Portainer. The initial container was set up through Hub, which probably messed things up.

That makes sense! The OP might be managing two different contexts — one for the actual Docker Engine and another for Docker Desktop.