Docker swarm-manager displays old container information

I am using docker-machine with Google Compute Engine(GCE)
to run a
docker swarm cluster. I created a swarm successfully with 2
(swnd-01 & swnd-02) in the cluster. I created a daemon container
like this
in the swarm-manager environment:
docker run -d ubuntu /bin/bash

docker ps shows the container running on swnd-01. When I tried
executing a command over the container using docker exec I get the
error that container is not running while docker ps shows otherwise.
I ssh‘ed into swnd-01 via docker-machine to come to know that container
exited as soon as it was created. I tried docker run command inside the
swnd-01 but it still exits. I don’t understand the behavior.

  • Why are there so many docker images with vulnerabilities? [closed]
  • How to run a command after creating a container using yml file
  • How to link Docker services across hosts?
  • How do I find out why my Docker service is in Pending state?
  • AAPT2 failing to merge resources on Docker
  • NCurses in Docker Container
  • Any suggestions will be thankfully received.

  • Can (should) Docker be used for winforms applications?
  • Docker Python File Input Selector
  • Is it possible for image to have multiple tags?
  • docker website opens after a while - ec2/virtualbox
  • Is there a way to make docker containers truly fault-tolerant?
  • Is it possible to run Vagrant with Docker as provider AND provisioner?
  • One Solution collect form web for “Docker swarm-manager displays old container information”

    The reason it exits is that the /bin/bash command completes and a Docker container only runs as long as its main process (if you run such a container with the -it flags the process will keep running while the terminal is attached).

    As to why the swarm manager thought the container was still running, I’m not sure. I guess there is a short delay while Swarm updates the status of everything.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.