Create a custom Docker network for container-to-container communication

domain: docs.docker.com · 6 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Create a bridge network for single-host isolation: docker network create -d bridge mynet
  2. For multi-host networking, enable Swarm mode then create an overlay network: docker network create -d overlay --attachable myoverlay
  3. Optionally constrain addressing with --subnet, --ip-range, --gateway: docker network create --driver=bridge --subnet=192.168.0.0/16 br0
  4. Restrict external access with --internal, or set DNS-driven endpoint mode with --opt com.docker.network.endpoint_mode=dnsrr on overlay networks
  5. Launch a container on the network: docker run -itd --network=mynet busybox
  6. Verify with docker network ls and inspect addresses with docker network inspect mynet

Known gotchas

Related routes

Create a custom podman network and connect containers to it
containers · 5 steps · unrated
Create a custom podman network and connect containers
docs.podman.io · 8 steps · unrated
Create an IPvlan l2-mode Docker network and run a container on it
docs.docker.com/network/drivers/ipvlan · 7 steps · unrated

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?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans