I am running a VM with Container-Optimized OS.
I want a container that both:
- A. Binds to the external IP of the VM.
- B. Contacts a sibling container, that listens on 127.0.0.1:3010.
An issue I am having is that by default "A" works and "B" does not.
If I pass --net host
, "A" stops working, and "B" works.
I think COS has some hidden special config to make it appear like containers run with --net host
. This allows external traffic to the VM's IP:port for each container that binds to a port.
Because of this hidden config, it means if I try to run containers on --net host
, it removes the ability to reach the container from outside the VM.
How can I enable A and B?