How to set Network Bridge mode for containers

Assuming I have two Single Board Computers (SBCs, maybe different types), each with a container. Two SBCs are in the same network.

My goal is to let two containers communicate with each other. I already have programs to send messages and receive message. Just need two containers to be on the same network. First thing is to let container have Bridge mode network access. But I am not familiar with network setup. I don’t have a clue on what to do.

Can anyone tell me what I should do?
Thanks.

PS. I created containers in amd64, using build-local, they are fine, two amd containers can talk to each other, but arm containers can not. Also tried docker run --network bridge… not working.

 I tried macvlan, programs working in one computer with multiple containers, but did not work between two computers.

It seem two computer containers can communicate with “docker run …-network host image_id bash”.

so my problem is solved.

Greetings @matty,

It seem two computer containers can communicate with “docker run …-network host image_id bash”.

Glad you were able to resolve your issue here. Yeah having containers run on the host network can be a quick and easy way to have communication work between containers. Since running on the host network is basically the same as a native process would.

Though if you are interested in inter-container network communication without exposing your containers to the host network I would recommend giving this documentation from Docker a read: Networking with standalone containers | Docker Docs

As shown in this document having containers communicate with each other is fairly simple. Especially if you use a user-defined bridge network. Then you can just ping each container by their name instead of IP address for easy deterministic access.

Best Regards,
Jeremias

Thanks Jeremias.tx. I will read these docker documents.