7.2.2.5 Host Driver Limits
A focused guide to Host Driver Limits, connecting core concepts with practical Docker and container operations.
Host driver limits encompass the specific constraints and platform limitations associated with --network host, including its general unavailability on Docker Desktop for Mac and Windows and its incompatibility with certain other Docker networking features.
Limited Availability on Docker Desktop
Host networking behaves differently or is unavailable as expected on Docker Desktop for Mac and Windows, since these platforms run the Docker daemon inside a lightweight virtual machine, meaning "the host" from the container's perspective is actually that VM, not the user's actual physical machine.
docker run -d --network host nginx:alpine
On Docker Desktop, this does not provide direct access to the actual Mac or Windows host's network the way it would on a native Linux installation.
Incompatibility With Certain Port Publishing Behavior
Because host networking bypasses the isolated network namespace that port publishing exists to bridge, the -p flag has no meaningful effect when combined with --network host.
docker run -d --network host -p 8080:80 nginx:alpine
This combination is generally not meaningful, since host networking already exposes the container's bound ports directly without needing publishing at all.
Why Host Networking Doesn't Combine With User-Defined Networks
A container cannot simultaneously use host networking and also be attached to a separate, isolated user-defined network in the typical sense, since host networking specifically means using the host's namespace rather than any isolated one.
docker run -d --network host myapp:1.0
This container's networking is entirely defined by sharing the host's namespace, rather than participating in any separately defined network.
Why Understanding Host Driver Limits Matters
Recognizing these platform-specific and feature-specific limitations is important before relying on host networking for a particular use case, since assuming it behaves identically across every platform and combines freely with every other networking feature can lead to unexpected, confusing behavior, particularly when developing on Docker Desktop versus deploying on native Linux.