Search code examples
mongodbdockerdocker-swarm

Docker Swarm mode - equivalent docker commands to docker run -it ubuntu


I am trying to deploy a mongodb cluster on docker swarm mode, all the mongod daemon are in the same overlay network.

I need to configure the mongodb cluster, i am trying to find a command that works like docker run -it ubuntu in docke rswarm mode so i can log in, any ideas?

Or is there any other way to access the overlay network.


Solution

  • SOLUTION:

    First ssh to the node that runs the container, then find out the container id using docker ps and simply use docker exec -it $(id) bash to log on to the container.