#311 Forward deployed engineer interviews 5.3 min
Zero Egress? Test a Docker Internal Network
A customer says no data may leave. Here is a test that shows whether a closed container can reach the internet.
Run the egress test
Copy the code folder first. With Docker running, in that folder run docker compose -p egress up -d peer, then docker compose -p egress run --rm -T probe_open, then docker compose -p egress run --rm -T probe_closed, then docker compose -p egress down. In the video the open probe printed internet reachable and peer name not found, and the closed probe printed internet blocked and peer reachable.
A hint
The control only works on a machine that has internet access.
Predict a typo in the peer name
In probe.py change PEER = ("peer", 8000) to PEER = ("peerr", 8000). Predict the peer line for the closed probe, then run the same four commands as before. This is a prediction exercise. Which of the three words reachable, name not found or blocked should it print, and why? Then change PEER back to ("peer", 8000).
A hint
The probe asks Docker's name lookup for the host name first.
Predict what happens without internal
In compose.yaml delete the line internal: true under closed. This is a prediction exercise. Before running anything, write down what you expect the closed probe to print for the internet and for the peer, then run the four commands and compare. What does this tell you about why the test needs a control? Then put the line internal: true back under closed, because the next exercise needs it.
A hint
The video says a Compose network is open to the outside by default.
Predict a container on both networks
In compose.yaml change probe_closed to networks: [closed, open]. This is a prediction exercise. Write down what you expect it to print for the internet and for the peer, then run the commands and compare. The video lists a container on both networks as a mistake. Explain in one sentence why it is one. Then change probe_closed back to networks: [closed].
A hint
The container is also on the open network, which is not marked internal.
These tasks are for you to try on your own machine. Nothing is checked or saved.
What this does not show
One run on one laptop with Docker 27.5.1: a container only on an internal network could not open a connection to one public address. The probe prints, it does not fail a build. A second network, host rules, a proxy, a mounted socket and name lookups were not tested. The image is not pinned by digest.
Up next in Forward deployed engineer interviews
More in Forward deployed engineer interviews
- #302 Forward Deployed Engineer Interview: What Is Tested
- #303 The FDE Decomposition Round: Vague Ask to a Plan
- #304 Scope an AI Pilot: Metric, Baseline and Stop Rule
- #305 Retry a Flaky API Without Duplicates: Idempotency Keys
- #306 Webhooks Done Right: Signatures, Retries and Replays
- #307 Schema Drift: Map a Customer's Data and Catch Changes
Related videos
- #302 Forward Deployed Engineer Interview: What Is Tested Forward deployed engineer interviews
- #303 The FDE Decomposition Round: Vague Ask to a Plan Forward deployed engineer interviews
- #305 Retry a Flaky API Without Duplicates: Idempotency Keys Forward deployed engineer interviews
- #306 Webhooks Done Right: Signatures, Retries and Replays Forward deployed engineer interviews
