None Networking Mode (--network none) for Air-Gapped Workloads
Run containers with no network stack for sandboxed or air-gapped jobs.
In plain words
Use none for preprocessing, converters or sandboxed jobs whose complete input and output travel through files or pipes.
Think of it like…
The workload is placed in a quiet room with the door removed and a document tray at the wall-data can enter only through the planned handoff.
Where you’ve seen it
In practice, docker run --rm --network none -v $(pwd)/in:/in:ro -v $(pwd)/out:/out alpine:3.21 sh -c "gzip -c /in/a.csv > /out/a.csv.gz" is the concrete move for this job: run containers with no network stack for sandboxed or air-gapped jobs. The release is not accepted until ip route inside the container should show no external route, while the host verifies the expected output file checksum confirms the result.
Words you’ll hear
- --network none
- The implementation control in
docker run --rm --network none -v $(pwd)/in:/in:ro -v $(pwd)/out:/out alpine:3.21 sh -c "gzip -c /in/a.csv > /out/a.csv.gz"for run containers with no network stack for sandboxed or air-gapped jobs. - Air-Gap
- The result to observe with
ip route inside the container should show no external route, while the host verifies the expected output file checksum, rather than infer from a successful command alone. - Sandbox
- The production boundary exposed when forgetting that a none container with a writable Docker socket or privileged host access is still not isolated from the machine.
Visual diagram
Theory & deep dive
--network none control path
The concrete mechanism is docker run --rm --network none -v $(pwd)/in:/in:ro -v $(pwd)/out:/out alpine:3.21 sh -c "gzip -c /in/a.csv > /out/a.csv.gz". The observable result is ip route inside the container should show no external route, while the host verifies the expected output file checksum; if those disagree, inspect the runtime evidence before changing unrelated settings.
Run containers with no network stack for sandboxed or air-gapped jobs. Keep --network none, Air-Gap and Sandbox in the same deployment record so the intent and the observed state cannot drift apart.
docker run --rm --network none -v $(pwd)/in:/in:ro -v $(pwd)/out:/out alpine:3.21 sh -c "gzip -c /in/a.csv > /out/a.csv.gz"
ip route inside the container should show no external route, while the host verifies the expected output file checksum, not with command success alone.Sandbox failure boundary
A service that silently retries DNS or downloads a model will hang rather than self-explain. “Air-gapped” still needs filesystem, CPU, host-kernel and volume controls; network mode is not a complete security sandbox. The narrow failure to design for is forgetting that a none container with a writable Docker socket or privileged host access is still not isolated from the machine.
Accept this compromise explicitly: No-network mode is a strong network boundary for bounded workloads; it blocks package installation, telemetry and secret retrieval at runtime. The controlled check-ip route inside the container should show no external route, while the host verifies the expected output file checksum-also identifies the point where a different design is safer.
Exercise this failure safely: forgetting that a none container with a writable Docker socket or privileged host access is still not isolated from the machine.
How it works, step by step
Step 1 of 41. State the boundary
Write down why the workload needs this: A service that silently retries DNS or downloads a model will hang rather than self-explain. “Air-gapped” still needs filesystem, CPU, host-kernel and volume controls; network mode is not a complete security sandbox.
- Intent
- --network none
When to use it & trade-offs
What it is
--network none gives a container its own otherwise empty network namespace with loopback only. It cannot resolve external DNS or connect out unless a new interface or namespace join is deliberately introduced.
Why it matters: A service that silently retries DNS or downloads a model will hang rather than self-explain. “Air-gapped” still needs filesystem, CPU, host-kernel and volume controls; network mode is not a complete security sandbox.
When to reach for it
- The fit is strongest for this job: run containers with no network stack for sandboxed or air-gapped jobs. Pair it with
ip route inside the container should show no external route, while the host verifies the expected output file checksumin the runbook. - Production --network none changes should make Air-Gap observable through
docker run --rm --network none -v $(pwd)/in:/in:ro -v $(pwd)/out:/out alpine:3.21 sh -c "gzip -c /in/a.csv > /out/a.csv.gz", rather than trusting the runtime default. - Keep a rollback example for the case where forgetting that a none container with a writable Docker socket or privileged host access is still not isolated from the machine.
When to avoid or be careful
- Do not accept command success while the system can still fail by forgetting that a none container with a writable Docker socket or privileged host access is still not isolated from the machine.
- Avoid erasing Sandbox protection merely to dodge this cost: “No-network mode is a strong network boundary for bounded workloads; it blocks package installation, telemetry and secret retrieval at runtime”.
- Do not replace the evidence path-
ip route inside the container should show no external route, while the host verifies the expected output file checksum-with a screenshot or a mutable tag.
docker run --rm --network none -v $(pwd)/in:/in:ro -v $(pwd)/out:/out alpine:3.21 sh -c "gzip -c /in/a.csv > /out/a.csv.gz": practical choices
Strengths: --network none gives a container its own otherwise empty network namespace with loopback only. It cannot resolve external DNS or connect out unless a new interface or namespace join is deliberately introduced.
Watch out: No-network mode is a strong network boundary for bounded workloads; it blocks package installation, telemetry and secret retrieval at runtime.
Strengths: It can begin with docker run --rm --network none -v $(pwd)/in:/in:ro -v $(pwd)/out:/out alpine:3.21 sh -c "gzip -c /in/a.csv > /out/a.csv.gz" and fewer surrounding controls.
Watch out: It silently accepts forgetting that a none container with a writable Docker socket or privileged host access is still not isolated from the machine, which makes the result hard to reproduce after promotion.
Strengths: A service that silently retries DNS or downloads a model will hang rather than self-explain. “Air-gapped” still needs filesystem, CPU, host-kernel and volume controls; network mode is not a complete security sandbox.
Watch out: The platform adds an ownership and debugging layer; retain ip route inside the container should show no external route, while the host verifies the expected output file checksum as the direct check.
Interview signals & numbers to know
When this topic comes up
- docker run --rm --network none -v $(pwd)/in:/in:ro -v $(pwd)/out:/out alpine:3.21 sh -c "gzip -c /in/a.csv > /out/a.csv.gz"
- ip route inside the container should show no external route, while the host verifies the expected output file checksum
- Failure signature: forgetting that a none container with a writable Docker socket or privileged host access is still not isolated from the machine
- Trade-off: No-network mode is a strong network boundary for bounded workloads; it blocks package installation, telemetry and secret retrieval at runtime.
Benchmarks & rules of thumb
- 1 interface
- loopback is present
- 0 external routes
- under ordinary none mode
- 2 planned file handoffs
- read-only input and writable output mounts
Common mistakes & follow-ups
Common interview mistakes
- Treating a successful
docker run --rm --network none -v $(pwd)/in:/in:ro -v $(pwd)/out:/out alpine:3.21 sh -c "gzip -c /in/a.csv > /out/a.csv.gz"as proof and skippingip route inside the container should show no external route, while the host verifies the expected output file checksum. - Forgetting that a none container with a writable Docker socket or privileged host access is still not isolated from the machine
- Optimizing --network none without accepting that no-network mode is a strong network boundary for bounded workloads; it blocks package installation, telemetry and secret retrieval at runtime.
Likely interviewer follow-ups
- Why does
docker run --rm --network none -v $(pwd)/in:/in:ro -v $(pwd)/out:/out alpine:3.21 sh -c "gzip -c /in/a.csv > /out/a.csv.gz"address --network none here rather than through application code? - How would you distinguish healthy Air-Gap from the failure “forgetting that a none container with a writable Docker socket or privileged host access is still not isolated from the machine” using
ip route inside the container should show no external route, while the host verifies the expected output file checksum? - When would this trade-off-“No-network mode is a strong network boundary for bounded workloads; it blocks package installation, telemetry and secret retrieval at runtime”-justify a different Sandbox design?
docker run --rm --network none -v $(pwd)/in:/in:ro -v $(pwd)/out:/out alpine:3.21 sh -c "gzip -c /in/a.csv > /out/a.csv.gz"-and one proof-ip route inside the container should show no external route, while the host verifies the expected output file checksum. Then name the boundary: forgetting that a none container with a writable Docker socket or privileged host access is still not isolated from the machine.Knowledge check
Put it into practice
Practice related interview Q&A
Apply None Networking Mode (--network none) for Air-Gapped Workloads with generative AI interview Q&A and hands-on practice.