Correct way to set the --network=container:<my_container> parameter?

23 Views Asked by At

What is the correct way in Google Container Optimised OS to do the equivalent of --network=container:<my_container> to route all traffic from one container to another? I'm attempting to route all traffic (or as a fallback just HTTP/HTTPS) to another container.

I'm unsure if there's a better way to achieve this than the following options i've some up with:

  1. Running the docker run ... command manually inside the container
  2. Using cloud-init to automatically run the docker run ... command with the network flag set
  3. Runtime forwarding (HTTP) traffic to the second container using a proxy to fire over all connections

Each of these solutions comes with a bunch of additional problems, is there a better solution to make this work?

1

There are 1 best solutions below

0
Dion V On

There is a documentation in Github that suggests on creating Traffic Director.