How to define task dependency with Docker container mode networking?

Hello.

With 2 tasks (one sidecar: wireguard, one app container: http-server) in the same group, how can I define that the app container should share the same network interfaces with its sidecar? I normally use --network=container:wireguard with Docker, but with Nomad I’m not sure how to make the sidecar a dependency and get its container name to be used with the actual task’s config.

Hi @0xbkt,

Since the two tasks are in the same group they will automatically share the same network namespace.

Is this not happening for you? Could you share a sample job file?

Thanks!