Documentation for the "container" container network mode


#1

When adding a container definition, there is an option under the “Networking” tab for a Network option… and one option is “Container.” I don’t see any documentation for this under the Networking section?


#2

With the network set to container a container will share the network stack of another container.

For more details, please check: https://docs.docker.com/engine/reference/run/#network-settings (Section Network: container)


#3

Is there a reason I’m not seeing this option?


#4

Possibly because it only applies to standalone containers, not services?


#5

Good call, thanks. Is there a way to use the compose “network_mode: container” option to share the networking stack of an infrastructure container, or one in a different stack?


#6

I could never get network_mode: container to work in a rancher config, when the exact same setting would work when executed directly on the docker host.

Moreover there are references to the elusive network_mode: service but neither of them are documented. Guidance would be appreciated.