How can I make connection between two services in docker swam?

How could I make connection between 2 services: MySQL & OCS in docker swarm the 2 services are in the same overlay network.

  • Dockerfile: How to replace a placeholder in environment variable with build-arg's?
  • Why is my volume empty when binding it to a host folder?
  • Share and update docker data containers across containers
  • ERROR: for couchbase-db driver failed programming external connectivity
  • How do you mount sub-directories from a named docker volume in a container?
  • Is it possible to run Telegraf in Docker (and get accurate metrics)?
  • Container Port Not Exposed in Kubernetes
  • Kubernetes - kubectl exec bash - session drop and line width
  • How can I add automated tag to my Docker repository?
  • Docker on Elastic Beanstalk - connect() failed (111: Connection refused) while connecting to upstream
  • Running rails migrations in docker container sometimes results in ActiveRecord::DuplicateMigrationNameError
  • How does docker-compose link work?
  • One Solution collect form web for “How can I make connection between two services in docker swam?”

    Just reference the other service by it’s service name with DNS. It should resolve.

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