How to set up 2 network isolated Docker containers (front and back-end)

Making this work might sound crazy, but if Docker has to be comparable in functionalities already provided by other types of virtualization, then this has to work right? Ok, this is the scenario, is a classic one: I need to deploy in one Docker host, 2 isolated containers, let’s say front-end and back-end. The Linux host will have 2 NICs, each one with a different subnet. Each container will use a different NIC and external subnet. For Docker this means 2 docker networks (fe-bridge and be-bridge), which translates to 2 Linux bridges. Traffic between containers is not allowed internally, it has to go to the external network where there is a Firewall. External management traffic will go directly to the containers but each one through its respective physical NIC. And of course, everything is connected to Internet. ...

August 6, 2021 · 9 min · 1907 words · Adrian Giacometti