Skip to content
Blog

Full Isolation with the Docker None Network Driver

Master total container isolation using Docker's none network driver (--network none) for air-gapped security sandboxing, untrusted workload processing, and offline batch execution.

Published on • November 17, 2026

AI Assistant

When containerizing workloads, default network bridge drivers provide containers with outbound internet connectivity and local DNS resolution. However, certain security-critical operations—such as handling untrusted user input, processing secret cryptographic keys, or performing offline batch analysis—require complete network isolation.

Docker’s built-in none network driver (--network none) provides absolute air-gapped network isolation at the container level by disabling external networking stack creation entirely.


How --network none Works Under the Hood

When you start a container with --network none, the Docker daemon creates a container network namespace that contains only the standard loopback interface (lo). No veth pair is attached to the host bridge, no external network routes are instantiated, and no default gateway is configured.

Default Bridge Network:
Container [eth0: 172.17.0.2] <---> vethXX <---> docker0 bridge <---> Host NIC <---> Internet

None Network (--network none):
Container [lo: 127.0.0.1] (No eth0 interface, no routes, completely offline)

Inside a none network container:

  • The process cannot make outbound HTTP/TCP/UDP calls.
  • The process cannot listen on network interfaces reachable outside 127.0.0.1.
  • DNS resolution fails instantly without network timeouts because no nameservers exist in the namespace.

Verifying Network Isolation via CLI

You can inspect the container network stack directly using standard Linux networking utilities.

1. Comparing Bridge vs. None Drivers

Running a container on the default bridge network exposes an eth0 interface with an assigned IP address:

docker run --rm alpine ip addr show

Output:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: eth0@if12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0

Now, launch the container with --network none:

docker run --rm --network none alpine ip addr show

Output:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo

2. Testing Outbound Connectivity

Attempting to ping an external endpoint or resolve a host produces immediate network errors:

docker run --rm --network none alpine ping -c 1 8.8.8.8

Output:

ping: sendto: Network is unreachable

Primary Use Cases for --network none

1. Untrusted Code Execution & Security Sandboxing

If your application runs user-submitted scripts, evaluates foreign expressions, or processes uploaded PDF/image binaries using legacy utilities, running those tasks inside --network none guarantees that compromised code cannot exfiltrate data, join botnets, or initiate server-side request forgery (SSRF) attacks.

docker run --rm \
  --network none \
  --read-only \
  --cap-drop=ALL \
  --security-opt no-new-privileges:true \
  -v $(pwd)/untrusted_file.pdf:/input/doc.pdf:ro \
  -v $(pwd)/output:/output \
  my-pdf-parser /input/doc.pdf /output/result.json

2. Cryptographic Operations and Offline Key Generation

Generating long-term RSA keys, wallet seeds, or decrypting sensitive offline archives should never occur on containers attached to outbound networks. Using --network none creates a hardened enclave on the local host.

docker run --rm \
  --network none \
  -v $(pwd)/keys:/keys \
  alpine sh -c "apk add --no-cache openssl >/dev/null 2>&1 || true; openssl genrsa -out /keys/private.pem 4096"

3. Batch Processing of Local Mount Data

Batch jobs that perform CPU-intensive transformations on local volumes (e.g., video re-encoding, image thumbnail generation, log parsing) do not require remote API access. Restricting network access prevents accidental remote telemetry reporting or dependency updates during batch runs.


Docker Compose Integration

To configure absolute isolation in Docker Compose, specify network_mode: none on the service definition:

services:
  batch-processor:
    image: python:3.12-slim
    network_mode: none
    volumes:
      - ./data/inbound:/data/inbound:ro
      - ./data/outbound:/data/outbound:rw
    command: ["python", "-m", "processor", "--input", "/data/inbound"]
    restart: "no"

Combining none Network with Container Hardening

For maximum security defense-in-depth, combine network isolation with file system and privilege restrictions:

  1. --network none: Disables external network IO.
  2. --read-only: Prevents runtime modification of root filesystem binaries.
  3. --cap-drop=ALL: Removes all Linux kernel capabilities (CAP_NET_RAW, CAP_SYS_ADMIN, etc.).
  4. --user 65534:65534: Runs the process as an unprivileged user (nobody).
docker run --rm \
  --network none \
  --read-only \
  --tmpfs /tmp:rw,noexec,nosuid \
  --cap-drop=ALL \
  --user 65534:65534 \
  my-sandbox-image:latest

Takeaway: Docker’s none network driver provides total air-gapped network isolation by creating a container namespace with only the local loopback interface. It is the gold standard for sandboxing untrusted execution, processing cryptographic material, and enforcing zero-trust compliance.


Sources