Communicating between containers

Overview

The Docker environment is initialized when you create the first node in a cluster. As part of the configuration by design, MedStack enforces Docker uses an encrypted overlay network. This network is only accessible to the containers in the Swarm. As such, container-to-container communication can be done using the service name oppose to the container address.

Docker network requests

When a service is created in the Docker environment on MedStack, the hostname to access this service is mapped to the service name. This means that you may configure your services to communicate between their containers using the service name.

The service name is established when configuring the service. We recommend this method of communicating between services rather than requesting the container addresses.

For example, in a Docker environment with two services named, flask-app and postgres, the following network request could be ran from one of the flask-app containers opening it in a shell:

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Submit a request for support Submit a request for support