DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

Docker Networks Explained: Choosing Bridges, DNS, and Proxy-to-App Boundaries

Docker Compose service discovery and container reachability depend on shared network membership. See how to separate a proxy, app, and database, and what internal networks do.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a typical Docker Compose application, use the project’s user-defined bridge network rather than Docker’s default bridge: Compose then provides service-name discovery, and network membership determines which containers can communicate. A common proxy/app/database layout puts the proxy and database on separate networks, with the app attached to both. Mark a network internal: true only when its members should not use that network for external connectivity; a service attached to another, regular network may still reach the internet.

Docker’s default bridge and a Compose network are not the same thing

Docker Engine creates a network named bridge and connects containers to it when no network is specified. It is distinct from a user-defined bridge network, even though both use the bridge driver. Docker recommends user-defined bridges for application communication because they scope connectivity to their members and provide automatic name and alias resolution. Docker’s bridge network documentation describes these distinctions.

As an Amazon Associate I earn from qualifying purchases.

Network choice Name discovery Typical use
Docker Engine’s default bridge Does not provide the same automatic container-name resolution as a user-defined bridge. Default attachment when no network is selected; not the recommended basis for a Compose application stack.
User-defined bridge Attached containers can resolve each other by name or alias. Scoped communication among containers on the same Docker Engine host.
Compose project network Compose registers service names for discovery among services sharing the network. Default network for a Compose project, or one of multiple networks for a segmented stack.

Compose’s ordinary project network is a user-defined network by default. By contrast, setting a service’s network_mode: bridge connects it to Docker Engine’s default bridge; Docker’s Compose service reference notes that the default bridge does not provide service-name DNS and recommends a user-defined network for that use. See the Compose service reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How Compose service-name DNS works

When no custom networks are declared, Compose creates one project network and attaches the project’s services to it. Docker’s documentation puts it simply: “By default, Compose sets up a single network for your app.” Services on that shared network can address one another by service name. For example, an app can use db as the database hostname if both services share a network. Docker’s Compose networking guide explains the default and custom-network behavior.

#1 Best Overall
Sale
NETGEAR 5-Port Gigabit Ethernet Unmanaged Network Switch (GS305) | Home Network Hub, Office Ethernet Splitter, Plug-and-Play, Silent Operation, Desktop or Wall Mount, Essentials Model
  • GIGABIT ETHERNET PORTS: Features 5 x 1.0Gbps Ethernet ports for high-speed connectivity. Auto-negotiating ports detect the optimal speed for connected devices and work with existing Cat5e or Cat6 Ethernet cables.
  • PLUG-AND-PLAY UNMANAGED NETWORK SWITCH: Simple plug-and-play setup with no software to install or configuration required.
  • FLEXIBLE MOUNTING OPTIONS: Compact metal design supports desktop or wall-mount placement for versatile installation.
  • SILENT & ENERGY-EFFICIENT OPERATION: Fanless design ensures silent performance, while IEEE 802.3az Energy Efficient Ethernet reduces power consumption without compromising high-speed network performance.
  • REGIONAL COMPATIBILITY: Made for use in U.S. & CA only

Use the service name in application configuration, not a container IP you expect to remain fixed. The name is the discovery mechanism; it does not promise a permanent IP address. When services do not share a network, they do not have that network path for communicating with one another.

Build a proxy, app, and database topology

A simple least-connectivity layout gives the proxy a frontend network, the database a backend network, and the app both. The proxy and database then have no shared network, while the app can communicate with each. “Proxy network” here means a network in this application topology; it is not a built-in Docker network driver.

Rank #2
Sale
TP-Link TL-SG105, 5 Port Gigabit Unmanaged Ethernet Switch, Network Hub, Ethernet Splitter, Plug & Play, Fanless Metal Design, Shielded Ports, Traffic Optimization
  • 𝗢𝗻𝗲 𝗦𝘄𝗶𝘁𝗰𝗵 𝗠𝗮𝗱𝗲 𝘁𝗼 𝗘𝘅𝗽𝗮𝗻𝗱 𝗡𝗲𝘁𝘄𝗼𝗿𝗸: 5× 10/100/1000Mbps RJ45 Ports supporting Auto Negotiation and Auto MDI/MDIX.
  • 𝗚𝗶𝗴𝗮𝗯𝗶𝘁 𝘁𝗵𝗮𝘁 𝗦𝗮𝘃𝗲𝘀 𝗘𝗻𝗲𝗿𝗴𝘆: Latest innovative energy-efficient technology greatly expands your network capacity with much less power consumption and helps save money.
  • 𝗥𝗲𝗹𝗶𝗮𝗯𝗹𝗲 𝗮𝗻𝗱 𝗤𝘂𝗶𝗲𝘁: IEEE 802.3X flow control provides reliable data transfer and Fanless design ensures quiet operation.
  • 𝗣𝗹𝘂𝗴 𝗮𝗻𝗱 𝗣𝗹𝗮𝘆: Easy setup with no software installation or configuration needed.
  • 𝗔𝗱𝘃𝗮𝗻𝗰𝗲𝗱 𝗦𝗼𝗳𝘁𝘄𝗮𝗿𝗲 𝗙𝗲𝗮𝘁𝘂𝗿𝗲𝘀: Prioritize your traffic and guarantee high quality of video or voice data transmission with Port-based 802.1p/DSCP QoS and IGMP Snooping.
services:
  proxy:
    image: nginx
    networks: [frontend]
  app:
    image: example-app
    networks: [frontend, backend]
  db:
    image: postgres
    networks: [backend]

networks:
  frontend: {}
  backend: {}

With this membership, the app can discover the proxy and database by service name on their respective shared networks. The proxy is not directly connected to the backend network, and the database is not directly connected to the frontend. Docker’s Compose documentation uses this network-membership pattern to illustrate separation. See the Compose network reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This is a network-segmentation example, not a complete production reverse-proxy configuration: it does not set up TLS, publish ports, authentication, health checks, database credentials, or host firewall policy. Configure those separately for the deployment.

Rank #3
Sale
NETGEAR 8-Port Gigabit Ethernet Unmanaged Network Switch (GS308)
  • GIGABIT ETHERNET PORTS: Features 8 x 1.0Gbps Ethernet ports for high-speed connectivity. Auto-negotiating ports detect the optimal speed for connected devices and work with existing Cat5e or Cat6 Ethernet cables.
  • PLUG-AND-PLAY UNMANAGED NETWORK SWITCH: Simple plug-and-play setup with no software to install or configuration required.
  • FLEXIBLE MOUNTING OPTIONS: Compact metal design supports desktop or wall-mount placement for versatile installation.
  • SILENT & ENERGY-EFFICIENT OPERATION: Fanless design ensures silent performance, while IEEE 802.3az Energy Efficient Ethernet reduces power consumption without compromising high-speed network performance.
  • REGIONAL COMPATIBILITY: Made for use in U.S. & CA only

What internal: true means

Set internal: true on a Compose network when its members should be externally isolated through that network. Docker describes an internal network as having no default gateway and no connection to host network interfaces; its network reference also describes routes and firewall rules that prevent traffic to or from other networks. Members can still communicate with one another on the internal network. The Compose network reference and the docker network create reference cover this behavior.

For example, a backend network can be declared as:

networks:
  backend:
    internal: true

Do not interpret this setting as making every attached service wholly offline. If a service is attached to both this internal backend and a regular network, it may still use the regular network for internet access. Assess the paths available through all of a service’s network memberships, not just whether one network is internal. Docker’s Compose networking guide calls out this multi-network behavior.

Rank #4
Sale
TP-Link LS1005G, Litewave 5 Port Gigabit Ethernet Unmanaged Switch
  • 【One Switch Made to Expand Network】Features 5 RJ45 ports with 10/100/1000Mbps speeds, supporting Auto-Negotiation and Auto MDI/MDIX for hassle-free setup. Ideal for expanding your network, with 1 uplink (input) port and 4 output ports to split your Ethernet connection to multiple devices.
  • 【Gigabit that Saves Energy】Latest innovative energy-efficient technology greatly expands your network capacity with much less power consumption and helps save money
  • 【Reliable and Quiet】IEEE 802.3X flow control provides reliable data transfer and Fanless design ensures quiet operation
  • 【Plug and Play】Easy setup with no software installation or configuration needed
  • 【Ethernet Splitter】Connect to your router or modem for additional wired connections (laptop, gaming console, printer, etc)
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Ports, host access, and the boundary of a bridge

Containers on a user-defined bridge can access one another’s ports across that network without publishing those ports to the host. To make a container port reachable from a different network or a non-Docker host, publish it with -p or --publish (or the corresponding Compose port configuration). Publishing is about exposing a port beyond the network peers; it is not required simply for two services on the same user-defined network to communicate. Docker’s bridge-driver documentation explains port reachability.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Bridge networks are local to containers on one Docker Engine host. They are not, by themselves, a cluster-wide network. For communication across hosts, Docker documents OS-level routing or an overlay network as possibilities; the appropriate choice depends on the deployment. The network creation reference discusses network scope.

Best Value
Sale
TP-Link TL-SG108S-M2, 8-Port Multi-Gigabit 2.5G Unmanaged Ethernet Switch
  • 𝗘𝗶𝗴𝗵𝘁 𝟮.𝟱 𝗚𝗯𝗽𝘀 𝗣𝗼𝗿𝘁𝘀 𝗳𝗼𝗿 𝗦𝘂𝗽𝗲𝗿-𝗙𝗮𝘀𝘁 𝗖𝗼𝗻𝗻𝗲𝗰𝘁𝗶𝗼𝗻𝘀: 8× 2.5-Gigabit ports unlock the highest performance of your Multi-Gig bandwidth and devices, and provide up to 40 Gbps of switching capacity.
  • 𝗔𝘂𝘁𝗼-𝗡𝗲𝗴𝗼𝘁𝗶𝗮𝘁𝗶𝗼𝗻: Auto-negotiation intelligently senses the link speeds and adjusts between 3-speeds (100Mb/1G/2.5G) for compatibility and optimal performance for all your devices, including 2.5G WiFi 6 AP, 2.5G NAS, 2.5G PCIe Adapter, 2.5G Server, gaming computer, 4K video, and more.
  • 𝗜𝗱𝗲𝗮𝗹 𝗳𝗼𝗿 𝗩𝗮𝗿𝗶𝗼𝘂𝘀 𝗦𝗰𝗲𝗻𝗮𝗿𝗶𝗼𝘀: Built for LAN parties, home entertainment, small and home offices, and instant transfer for workstations.
  • 𝗛𝗮𝘀𝘀𝗹𝗲-𝗙𝗿𝗲𝗲 𝗖𝗮𝗯𝗹𝗶𝗻𝗴: Instantly upgrade to 2.5 Gbps without the need to upgrade to Cat6 wiring, reducing wiring costs and hassle. *
  • 𝗦𝗶𝗹𝗲𝗻𝘁 𝗢𝗽𝗲𝗿𝗮𝘁𝗶𝗼𝗻: Industry-leading fanless design ensures silent operation, ideal for any home or business.

When a Compose project uses an existing network

Compose can use a pre-existing network as an external network rather than managing that network as part of the project. This can be useful when multiple projects need to share a network, but the external network must already exist before docker compose up. The project does not create that external network for you. The Compose network reference documents external networks.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.