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.
Video #311 ยท Forward deployed engineer interviews
Steps in the video
Files
- compose.yaml (19 lines)
- probe.py (19 lines)
Tested with
Python 3.12.15
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.
Sources
Learning IT by Example.