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
nodes
(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.

  • Boot2Docker on Mac - Returns bsdthread_register error
  • How do I point a docker image to my .m2 directory for running maven in docker on a mac?
  • docker run python from container
  • Should Docker be used in a non devops, not very agile environment? [closed]
  • Docker Volumes when updating the image
  • Deploying an Angular app using Docker/Dokku
  • Any suggestions will be thankfully received.

  • Windows Containers : Unable to ping containers created with transparent network from other hosts
  • docker run <IMAGE> <MULTIPLE COMMANDS>
  • Discourse Docker and Apache on one server
  • Finding Docker container processes? from host point of view
  • How can you make the docker container use the host machine's /etc/hosts file?
  • Docker LVM plugin install issues
  • 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.