NetOps Observer
← All labs

Container network topology / Intermediate / 20–30 min

The service on the other Docker network

A healthy service and client cannot communicate because their network memberships do not overlap. Trace Docker's network-scoped service discovery.

LAB IDnetops-04-isolated-networksTRACK / netops.observer
Engineer inspecting network switches and cables

The scenario

The API responds inside its own container, but the client cannot resolve its Compose service name. Restore a shared internal network through Compose without publishing host ports or changing the application.

Mission objectives

  • Reproduce the name-resolution failure and verify the service locally.
  • Inspect container membership in the two internal Docker networks.
  • Persist a shared network in Compose and verify service discovery and HTTP traffic.

Lab README

The service on the other Docker network

The API is running and responds locally, but the client cannot resolve its service name. Investigate the two Docker networks and restore communication using the Compose configuration. Keep both networks internal, preserve the application and do not publish host ports or hardcode an IP address.

Before you begin

Use a disposable machine with Bash, Python 3, Docker and Docker Compose. The lab creates the Compose project breakfix-netops-04 and two internal Docker networks. It does not publish ports or create cloud resources. Docker may download the Python image. Do not reuse the project name; setup refuses existing project resources and teardown checks ownership.

Investigate

./setup.sh
docker compose -p breakfix-netops-04 ps
docker compose -p breakfix-netops-04 exec api python -c 'from urllib.request import urlopen; print(urlopen("http://127.0.0.1:8080/health.txt").read().decode())'
docker compose -p breakfix-netops-04 exec client python -c 'import socket; print(socket.getaddrinfo("api", 8080))'
docker network inspect breakfix-netops-04_front breakfix-netops-04_back

Inspect compose.yaml. Preserve the existing networks and persist your network change there; recreate the affected container with Compose so the configuration and running state agree. Then run ./verify.sh and ./teardown.sh. Teardown removes the lab containers and networks but does not reset edited files; re-extract the bundle to start again.

The related Docker networking guide and demo show a network inspection and a direct container request. The demo does not reproduce this split-network scenario.

View Markdown source ↗

Get the lab

Download and inspect the installer before running it. It checks the archive's SHA-256 digest and refuses to overwrite an existing lab directory.

curl -fsSLO https://devops.download/labs/netops-04-isolated-networks.sh
less netops-04-isolated-networks.sh
bash netops-04-isolated-networks.sh
cd labs/netops-04-isolated-networks
./setup.sh

When you've made your changes, run ./verify.sh. Remove lab resources with ./teardown.sh.

Download the archive instead ↗

Need a nudge?

Hint #1

Compare the networks attached to each container, not just whether both containers are running.

Hint #2

Compose service names are discoverable on networks shared by the containers. Preserve both internal networks and update the Compose configuration.

Hint #3 · Related guide on opsbreakfix.com

Read the related guide ↗

Solved it?

Explore the related guide on opsbreakfix.com.

Continue to opsbreakfix.com ↗

One ecosystem.
Many perspectives.

Follow the connection from a hands-on lab to the knowledge and tools behind it.