There are two common ways to deliver an image to another machine. When a registry is available, push the image to it and pull it on the target machine. If the target cannot reach a registry, use docker save to write the image to an archive, verify the file after transfer, then use docker load on the target. This is image archiving, not the container-filesystem workflow handled by docker export and docker import.
Common commands at a glance#
For the private-registry examples, registry.example.com/team is a documentation placeholder, not a usable destination. Replace it with a registry and namespace where you have write access.
| Command | What it does |
|---|---|
docker images | List local images |
docker pull alpine:3.24 | Pull an image from Docker Hub and see its digest in the output |
docker tag SOURCE TARGET | Give a local image another tag |
docker login REGISTRY | Sign in to the target registry |
docker push IMAGE | Push an image to a registry |
docker save -o alpine_3.24.tar alpine:3.24 | Save the local image to a tar file |
docker load -i alpine_3.24.tar | Load the image from a tar file |
docker rmi alpine:3.24 | Remove the local image reference |
How images get from one machine to another#
Online distribution: The source pushes the image to a registry and the target pulls from it. A registry can host many image repositories. Docker Hub, private Harbor instances, and cloud provider container registries all fall into this category.
Offline distribution: The source exports the image as a tar file, transfers it via USB drive, rsync, or other file transfer methods, and the target loads the tar file to restore the image.
flowchart TD
accTitle: Online and offline image distribution
accDescr: The online path pushes an image to a registry and the target host pulls it. The offline path saves an image as a tar archive, transfers and verifies the file, then loads the image on the target host. These are different delivery choices.
subgraph online["Online: both hosts can reach a registry"]
sourceOnline["Image on source host"] -->|docker push| registry["Registry"]
registry -->|docker pull| targetOnline["Image on target host"]
end
subgraph offline["Offline: transfer a file"]
sourceOffline["Image on source host"] -->|docker save| archive["tar archive"]
archive -->|Transfer and verify file| received["Archive on target host"]
received -->|docker load| targetOffline["Image on target host"]
endpush and pull operate on a registry; save and load operate on an image archive. save does not export a container’s runtime state.
Understanding image names first#
A complete image reference looks like this:
registry.example.com/team/app:1.2.0Breaking it down:
registry.example.com: registry host addressteam: namespaceapp: repository name1.2.0: tag
Omitted parts use default values:
- Omit registry → defaults to
docker.io(Docker Hub) - A single-component official image name on Docker Hub gets the
library/prefix. A private registry does not get that default. - Omit tag → defaults to
latest
So alpine is actually docker.io/library/alpine:latest.
Misconception about latest
The publisher decides which version latest points to. It may point to a stable release or a development build, or remain unchanged for a long time. Use an explicit version tag such as alpine:3.24 in production.
Online distribution: pull, tag, login, push#
Pull a base image from a public repository:
docker pull alpine:3.24Look for Digest: in the output. It identifies the image manifest or multi-platform index returned for that pull. When recording a reproducible version, use the digest from your own pull result.
Say you want to push this image to your private registry at registry.example.com, namespace team. First tag the image with a new name:
docker tag alpine:3.24 registry.example.com/team/alpine:3.24tag doesn’t copy the image content—it just creates another reference to the same image. You can verify with docker images that both names have the same IMAGE ID.
Before pushing, log in to the target registry. The address below is a placeholder; replace it with a real destination where you have write access.
docker login registry.example.comEnter credentials when prompted. With a credential store configured, Docker delegates credential storage to it. Without one, credentials may be written to Docker’s configuration file as Base64-encoded data, which is not encryption. Prefer a system credential store; avoid logging in on shared accounts or untrusted hosts, and never put passwords or tokens in commands, scripts, configuration files, or Git.
Push the image:
docker push registry.example.com/team/alpine:3.24After pushing, sign in to the same registry on the target machine if required, then pull the image. Replace the placeholder destination with your actual registry:
docker pull registry.example.com/team/alpine:3.24Check the Digest: in the pull output. You can also inspect the registry digest recorded locally:
docker image inspect --format '{{json .RepoDigests}}' registry.example.com/team/alpine:3.24This registry.example.com/team/alpine:3.24 reference is also a placeholder. The target digest should correspond to the same image manifest or index pushed from the source. For multi-platform images, also confirm which platform variant the target selected.
Offline distribution: save, transfer, load#
On the source system, save the image as a tar archive:
docker save -o alpine_3.24.tar alpine:3.24The archive contains image layers and metadata for the variants available locally. Check that it includes the target platform. You can check the file size with ls -lh alpine_3.24.tar.
Generate a checksum to verify transfer integrity:
sha256sum alpine_3.24.tar > alpine_3.24.tar.sha256Transfer both the tar file and checksum file to the target system (via rsync, USB drive, HTTP download, etc.).
On the target system, change to the directory containing both files and verify the checksum.
sha256sum -c alpine_3.24.tar.sha256If it shows OK, the file transfer was complete. Then load the image:
docker load -i alpine_3.24.tar
docker images alpineThe image’s repository and tag will be restored according to the names used during save.
The checksum only detects transfer corruption, not image source trustworthiness. If you need to verify the image publisher’s identity, use image signing mechanisms (not covered in this article).
Choosing between tag and digest#
A tag such as alpine:3.24 is easy to remember, and the publisher can move it to newer content. A digest identifies the exact image manifest or multi-platform index for a release. Pulling by digest keeps that choice fixed even when the tag moves.
To pull the same release again, append @ and the value from the Digest: line in the earlier pull output.
docker pull alpine@sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bfRemoving a local image#
When you no longer need alpine:3.24 for the exercise, remove it by image:tag. Then check the local image list to verify that the tag is gone.
docker rmi alpine:3.24
docker images alpine:3.24If other tags point to the same image, Docker removes the specified tag and keeps the image content. If Docker reports that a container still references the image, check what the container is used for. Remove it if you no longer need it, then retry. This operation affects only the current Docker Engine’s local images.
Common issues#
Invalid image name format
Error response from daemon: invalid reference format
Check that registry address, namespace, repository, and tag follow naming rules. Tags can’t contain spaces or special characters.
Not logged in or no permission
denied: requested access to the resource is denied
Use docker login to log in and confirm your account has write access to the target repository.
Docker Hub pull rate limit
Docker Hub applies pull limits to anonymous and some authenticated users. The current limits depend on account type and may change. Check Docker Hub’s usage guidance when pulls are rate-limited. Signing in may help, but do not put personal credentials in scripts or shared environments.
Tag points to wrong target
Made a mistake with docker tag target name. Verify the reference is correct with docker images before pushing.
Platform mismatch
Check the operating system and architecture of the local image:
docker image inspect --format '{{.Os}}/{{.Architecture}}' alpine:3.24If the target host needs another platform, pull that variant before saving the archive. The publisher must provide that platform, and running a non-native architecture may also require emulation support.
docker pull --platform linux/amd64 alpine:3.24Load the archive only on a target compatible with its contents. docker load does not convert a single-platform image to another architecture.
Wrong archive path
Paths for docker save and load must be correct. Use -o to save a file and -i to load it.
The Alpine pull and local archive workflow were tested with Docker 29.9.3 on Linux ARM64. The private registry and cross-host transfer steps are documented examples.