Suggest an editImprove this articleRefine the answer for “How do containers exchange data with each other?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Containers** exchange data mostly through the network that Docker creates between them: usually this is a single virtual Docker network where containers see each other by name, like a domain address. **Key point:** the most common path is a Docker network, where containers see each other by name.Shown above the full answer for quick recall.Answer (EN)ImageContainers exchange data mostly through the **network** that Docker creates between them. Usually this is done within a single virtual Docker network, where containers see each other by name, like a domain address. --- ### **1. Exchange through a Docker network (the main way)** 1. Create a network: ```bash docker network create mynet ``` 2. Run containers in it: ```bash docker run -d --name app --network=mynet myapp docker run -d --name db --network=mynet mydb ``` Now the `app` container can reach `db` by the name `db` (for example, `mysql://db:3306`). *Summary:* safe network interaction within a single network. --- ### **2. Exchange through a shared volume** When files need to be passed (logs, data, cache): ```bash docker run -v shared:/data app1 docker run -v shared:/data app2 ``` Both containers use the same storage point. *Summary:* shared access to files. --- ### **3. Exchange through external services** Containers can interact through: - a database, - a message queue (Kafka, RabbitMQ), - HTTP/REST API requests. *Summary:* a scalable approach, common in microservices. --- ### **Summary for a junior** > Containers exchange data through a network (most often), a shared volume (for files), or external services. The most common path is a **Docker network, where containers see each other by name**. If needed, I can explain the same thing in the next message and **show how this looks in docker-compose**, where the connection between containers is fully automatic.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.