Docker driver, join container (task) to two docker (nomad) bridged networks

Hello! Just recently started using nomad, liking it so far!

I just have one question. This is related to the docker driver and/or the networking with nomad.

So, in docker, I could create two docker bridge networks then have a container join both of these networks when started up from either docker run or from a compose command docker compose up -d and I am wondering if something is possible like this within nomad without directly interacting with the docker engine on the host?

A task group listed in a job can only create a single bridged network correct (for that group)? So, I guess I would need containers that need to connect to each other to be in the same task group which will put them on the same bridged network (and they would require to be in the same job?), do I have that correct? This would appear that I won’t be able to have a single container (task) join two nomad networks, or two different bridged networks from different task groups.

Let me know if I need to provide more information.

Hi @azoller1, actually what happens is Nomad creates a single bridge (called nomad) on which all tasks using bridge network connect to, regardless of task driver. Connecting over the bridge does not require tasks being in the same group, just on the same host (obviously).

There isn’t support for anything more advanced than that, other than making use of Consul Connect or giving yourself total control via CNI plugin.

Thanks for the reply! I think I got it figured out now! I will need to look into using consul later, however, and vault :wink: