cli
cli copied to clipboard
running docker container with --network host should produce an error
the docs hiding a statement:
The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server.
running docker container with --network host
should produce an error and not run silently without working on the windows platform.
a simple warning could save many hours of network debugging for many developers trying to use the host driver on windows platform without knowing It is not supported.
please consider adding a warning, Thank you.
This one is a bit tricky; on docker desktop, --network host
actually works, but as the container is running inside a VM, the host
network namespace is the namespace of the VM (not the macOS or Windows host).
I can see some value in having a warning printed when using this option on Docker Desktop (but for that to work, it should probably be Docker Desktop producing the warning; this could possibly be done in the API proxy that's part of Docker Desktop; the API response allows for a list of Warnings
to be returned (which would be printed by the CLI); https://docs.docker.com/engine/api/v1.41/#tag/Container/operation/ContainerCreate
![Screenshot 2022-07-28 at 12 00 13](https://user-images.githubusercontent.com/1804568/181478919-403816a1-fc94-435d-9f9e-512e7a85c7e3.png)
/cc @djs55 wdyt?