Air-gapped image transfer with save and load
An air-gapped environment cannot rely on ordinary online pulls. Docker image save writes a local image archive; Docker image load reads that archive and restores images and tags. These commands are useful for controlled offline distribution, not complete application backup.
Worked example
Use this worksheet offline. Names and values are fictional; no live registry, credentials, Docker daemon or external requests are needed. Commands are illustrations, not observed results. Before separately authorized verification, identify the effective Docker endpoint, client credential configuration, builder and registry destination as applicable. Never disclose credential files or private context details.
Offline transfer plan (commands not executed)Source: docker image save -o bm-demo.tar bm-demo:1Transfer: verify approved archive hash via trusted recordDestination: docker image load -i bm-demo.tarDestination: docker image inspect bm-demo:1Use a fresh lab-owned output path, an approved local image and an approved removable-media or transfer process. Record image identity, platform, archive hash and provenance before transfer. Verify archive bytes against a trusted expected hash before loading; matching hashes cannot establish trust if the expected hash came from the same untrusted source. Loading may change existing local tags, so use an isolated engine with no name conflicts. Check the restored image and platform, then run an approved bounded smoke test with no pulling. A save archive is not the same byte representation as a registry manifest, so its SHA-256 is not the image manifest digest. Runtime volumes and container changes require separate backup. The included Python fixture checks only synthetic file transfer integrity. Save includes variants actually present in the source image store, not every platform available remotely. Select the platform explicitly where supported and verify identity and platform after load. The local transfer fixture generates both the expected hash and file locally; it is not independent authentication or a Docker archive parser.
Common mistake
Never load arbitrary archives from unknown sources; digest comparison is not an image security scan.
Manual practice
Write the pre-transfer and post-transfer checks. Run the optional synthetic transfer test and explain why it cannot validate an actual Docker archive.
Worksheet: lab-fixtures/docker-registries-and-delivery/07-save-load/scenario.txt.
Optional local exercise from package root: python3 lab-fixtures/docker-registries-and-delivery/07-save-load/transfer_demo.py. It checks a synthetic file copy and detects changed bytes, without reading any actual image archive.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Air-gapped image transfer with save and load — Knowledge check
Reason about image distribution and safe delivery.
Which pair transfers image archives?
Is archive SHA-256 the registry manifest digest?
What is not backed up by image save?