I have a docker swarm cluster. I deployed a Elassandra docker image. Now I want to find that the docker container's IP address for the seed node:
The following are my services in my swarm:
docker service ls
ID NAME
yjehoql7l976 elassandra_seed
I want find the IP address of the container for the Elassandra_seed node by its name to be used in my other docker compose file. Is that possible?
It is possible to find the IP address but remember it will change everytime the service restarts. Let's move onto finding the ip address.
docker service ps stack_service. Check the node column to find the name of the node.docker network ls. Usually the stack's network is named like this $stackname_network. Grab the ID of the network.docker inspect $networkid. This will show you the service name and its assigned IP address.