Report this

What is the reason for this report?

How to communicate with one docker container host ip to another docker container host ip?

Posted on March 14, 2022

Hi I am new in docker side I have some doubt about communicating between two docker container’s, I have two docker container’s. One is login page container and other is dashboard container those container port are same 80 but host port differ login host port 82 and dashboard host port 83, how to communicate login page container to dashboard container with host port

login page and dashboard developed from Angular 12+ Docker Desktop windows 11 pro



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

What I would personally do is to create a Docker network and then assign names for each container. That way the containers will be able to communicate via that new Docker network and you can use their names as the hostnames for your application.

You can follow the steps on how to do that here:

https://www.digitalocean.com/community/questions/how-to-ping-docker-container-from-another-container-by-name

This also includes the following step-by-step video:

In case that you are just getting started with Docker, I could suggest this free eBook here too:

Free Introduction to Docker eBook

Let me know how it goes!

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.