---
title: "Caching and Proxying Images in Air-Gapped Networks"
date: "2026-11-18T16:30:00+07:00"
description: "Architecting container distribution for air-gapped networks, setting up local pull-through caching proxies, offline bundle sync, and perimeter registry mirrors."
author: "AI Assistant"
image: "https://blog.redlinesoft.net/images/post/caching-proxying-images-air-gapped-networks.jpg"
alt: "Architecture diagram depicting secure unidirectional image sync from DMZ registry to isolated air-gapped network"
tags: ['docker', 'air-gapped', 'registry', 'security']
---

Air-gapped networks—environments completely disconnected from the public Internet for defense, financial, industrial control (SCADA), or compliance reasons—present unique challenges for container management. 

Standard workflows like `docker pull nginx:latest` or automated CI base image pulls fail completely without Internet connectivity.

In this architecture guide, we will explore container distribution strategies for air-gapped networks, including **Perimeter DMZ Registries**, **Unidirectional Data Diode Sync**, and **Offline Tarball Bundling**.

## Architecture Topologies for Air-Gapped Container Delivery

Depending on security mandates, air-gapped environments fall into three main network topologies:

```text
+-----------------------------------------------------------------------------------+
| Topology 1: DMZ Perimeter Registry with Unidirectional Sync                      |
|                                                                                   |
|  [Internet]                                                                       |
|      │                                                                            |
|      ▼                                                                            |
|  +--------------------+                                                           |
|  | DMZ Pull Registry  |                                                           |
|  +--------------------+                                                           |
|      │                                                                            |
|      ▼  (Controlled Unidirectional Sync / Hardware Data Diode)                    |
|  +--------------------+                                                           |
|  | Air-Gapped Registry| ----> [Isolated Kubernetes Cluster]                       |
|  +--------------------+                                                           |
+-----------------------------------------------------------------------------------+
| Topology 2: Strict Physical Air-Gap (Sneakernet Tarball Delivery)                |
|                                                                                   |
|  [Connected Dev Host] -> (docker save) -> [Encrypted USB/Tape] -> (docker load)   |
|                                                                     │             |
|                                                                     ▼             |
|                                                          [Air-Gapped Registry]    |
+-----------------------------------------------------------------------------------+
```

## Strategy 1: DMZ Perimeter Registry with Unidirectional Sync

In enterprise networks with strict perimeter controls, set up a dual-homed or DMZ registry server.

1. **DMZ Mirror**: Resides in a demilitarized zone (DMZ) with outbound access to Docker Hub or cloud registries.
2. **Scheduled Sync**: Uses tools like `skopeo sync` or Harbor Replication to fetch approved base images into the DMZ.
3. **Internal Replication**: Transfers approved images from the DMZ registry into the isolated internal network registry over a firewall-filtered, unidirectional tunnel.

### Automated DMZ Sync Script Example (Skopeo)

```bash
#!/usr/bin/env bash
set -euo pipefail

# Approved image sync list
IMAGES=(
  "docker.io/library/alpine:3.18"
  "docker.io/library/nginx:1.25"
  "docker.io/library/postgres:15-alpine"
)

PERIMETER_REGISTRY="dmz-registry.company.internal"
AIRGAPPED_REGISTRY="airgap-registry.isolated.net"

for img in "${IMAGES[@]}"; do
  repo_tag="${img#*/library/}" # Strips library prefix
  
  echo "Syncing $img to Air-Gapped Registry..."
  skopeo copy \
    --all \
    --src-creds "${DMZ_USER}:${DMZ_PASS}" \
    --dest-creds "${AIRGAP_USER}:${AIRGAP_PASS}" \
    "docker://${img}" \
    "docker://${AIRGAPPED_REGISTRY}/mirrors/${repo_tag}"
done
```

## Strategy 2: Sneakernet Offline Tarball Bundles

In ultra-secure facilities where no network link exists between the outside world and the air-gapped network, use **Tarball Archive Bundles**.

### Step 1: Export Complete Application Stacks (Connected Machine)

Pack all required images and multi-arch variants into compressed tar archives:

```bash
# Save multi-stage application image stack
docker save -o airgap-bundle-v1.0.tar \
  myregistry.com/app/frontend:v1.0.0 \
  myregistry.com/app/backend:v1.0.0 \
  postgres:15-alpine \
  redis:7-alpine

# Compress archive for physical media transfer
pigz airgap-bundle-v1.0.tar
```

### Step 2: Import Archive into Air-Gapped Registry (Isolated Machine)

After transferring the file via approved media (e.g. encrypted USB drive):

```bash
# 1. Uncompress archive
unpigz airgap-bundle-v1.0.tar

# 2. Load into local Docker daemon
docker load -i airgap-bundle-v1.0.tar

# 3. Retag for isolated internal registry
docker tag postgres:15-alpine airgap-registry.isolated.net/library/postgres:15-alpine
docker tag redis:7-alpine airgap-registry.isolated.net/library/redis:7-alpine

# 4. Push to internal registry
docker push airgap-registry.isolated.net/library/postgres:15-alpine
docker push airgap-registry.isolated.net/library/redis:7-alpine
```

## Strategy 3: Mirroring Helm and Kustomize Charts alongside Images

Applications rely on both container images and deployment manifests (Helm charts or Kustomize overlays).

Use **Zot** or **Harbor** as your internal air-gapped registry. Both store OCI images and Helm charts in the exact same registry engine!

```bash
# Push Helm chart directly as an OCI artifact to air-gapped registry
helm package ./my-chart/
helm push my-chart-1.0.0.tgz oci://airgap-registry.isolated.net/charts
```

## Best Practices for Air-Gapped Container Management

1. **Pin All Image Tags Explicitly**: Never use `:latest` or floating tags in air-gapped manifests. Unpinned tags will fail if the local cache does not contain the exact layer matching the request.
2. **Pre-Seed Host Node Caches**: Pre-load essential infrastructure images (Calico CNI, CoreDNS, kube-proxy) onto Kubernetes worker nodes before shipping machines to edge sites.
3. **Automate Vulnerability Scanning Inside the Air-Gap**: Deploy an offline-capable vulnerability scanner (like Trivy with offline database sync) inside the air-gapped network to scan images locally before deployment.

## Summary

Designing container delivery for air-gapped networks requires combining perimeter sync tools (Skopeo), self-hosted OCI registries (Harbor/Zot), and strict offline bundle management to maintain security and deployment velocity.
