Score:0

Communication between docker containers in different bridge

us flag

I have a docker setup with containers in two different bridge. I understand there is isolation between containers so they can't communicate with each others.

But my container A in bridge 1 expose port 443. So this port 443 is reacheable from the host and from external servers. As the port is explicitly exposed, It would make sens to be able to reach it from my containers in bridge 2 as well but it did not work.

From my containers in bridge 2, I can reach ports of service running my host (like port 22) but not the ports with nat forwarding to containers in bridge 1.

I'm not sure if the problem comes from iptable.. but I tried to add iptables -I DOCKER-USER -j ACCEPT without sucess

A.B avatar
cl flag
A.B
You have to define such setup *within* Docker's compose configuration. Trying to override it manually won't fly very far, won't last long (eg: won't survive a restart of a container).
radius avatar
us flag
The only way I see to do it within docker compose is to attach my containers in bridge 2 to the bridge 1, but I'd like to avoid that as it would allow all containers in bridge 2 to access to open ports in containers located in bridge 1
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.