Attach a service to the host network with network_mode: host and understand its port-mapping restrictions
domain: docs.docker.com/compose/compose-file/05-services · 5 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗
Documented steps
Set `network_mode: host` on the service to share the host network namespace (no port isolation, no separate bridge).
Do NOT also set the `networks:` key — network_mode: host cannot be combined with networks.
Because the container shares the host network, do not use `ports:` mapping with network_mode host (it produces a runtime error); attach to host ports directly.
For container/service namespace sharing alternatives, use network_mode: service:<name> or container:<name>.
Give your agent this knowledge — and 18,300+ more routes
One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?