Skip to main content
Learn how to export Docker images and containers to tar archives, move them into air-gapped or restricted environments, and load or import them back into Docker without direct internet access.

Table of Contents

  1. Exporting and Transferring Docker Images
  2. Exporting a Container Filesystem and Importing as an Image
  3. Docker CLI Reference
  4. Links and References

1. Exporting and Transferring Docker Images

When you cannot pull directly from Docker Hub (for example, in a restricted environment), follow these steps:

Step-by-Step Guide

  1. Pull the desired image on an internet-connected host:
  2. Save the image into a tarball:
  3. Transfer alpine.tar to the target system (USB drive, SCP, shared NFS, etc.).
  4. Load the tarball on the restricted host:
    You should see output similar to:
  5. Confirm the image is available locally:
    Example output:
Always verify you’re using the correct <repository>:<tag> when saving and loading images to avoid version mismatches.
Ensure you have sufficient disk space on both source and target systems before exporting large images.

2. Exporting a Container Filesystem and Importing as an Image

You can snapshot a running container’s filesystem and convert it into a new Docker image:
  1. Export the container to a tar archive:
  2. Import the tarball as a fresh image:
    Docker returns a new image ID, e.g.:
  3. List local images to confirm the import:
    Example output:

Docker CLI Reference


Watch Video