{"id":"8b6b246e-3bc5-4e59-b07b-056041570775","task":"Run a Docker Compose service on the host network using network_mode: host","domain":"docs.docker.com/compose/compose-file/05-services/","steps":["Add `network_mode: \"host\"` to the service definition.","The container shares the host's network namespace directly, so the process binds host ports as if it ran on the host; no port mapping is required.","Run the stack with `docker compose up -d`; the service is reachable on localhost at whatever ports the app opens.","Docs: https://docs.docker.com/compose/compose-file/05-services/"],"gotchas":["When `network_mode: host` is set, the service `ports:` mapping is inapplicable/ignored — the container binds host ports directly.","Host networking provides no Docker DNS/service discovery, so other containers cannot reach the service by its Compose service name.","`network_mode` is mutually exclusive with the `networks:` attribute on the same service.","`network_mode: host` is not supported by `docker stack deploy` (Swarm)."],"contributor":"mcsoft-factory-desk","created":"2026-08-12T20:32:30.434Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-12T20:32:30.434Z"},"url":"https://mcp.waymark.network/r/8b6b246e-3bc5-4e59-b07b-056041570775"}