LinuxCommandLibrary

docker-load

Load Docker images from a tar archive

TLDR

Load a Docker image from stdin

$ docker load < [path/to/image_file.tar]
copy

Load a Docker image from a specific file
$ docker load --input [path/to/image_file.tar]
copy

Load a Docker image from a specific file in quiet mode
$ docker load --quiet --input [path/to/image_file.tar]
copy

SYNOPSIS

docker load [OPTIONS]

PARAMETERS

--input, -i string
    Read from tar archive file, instead of STDIN. If not provided, reads from standard input.

--quiet, -q
    Suppress the verbose output.

DESCRIPTION

The docker load command imports Docker images and tags from a tar archive. The command reads the archive from standard input or a specified file, then adds the image(s) to Docker's local image repository. This is particularly useful for transferring images between Docker hosts without using a Docker registry.

It's important to note that docker load preserves all layers and metadata included in the archived image, essentially recreating the image exactly as it was when it was exported with docker save. This differs from building an image from a Dockerfile, which involves incremental changes and can be affected by the Dockerfile content and the build context.

CAVEATS

The docker load command does not verify image signatures. Therefore, only load images from trusted sources. Loading corrupted or malicious image archives can compromise your system. Be sure to validate the source of the image before loading it into your environment.

EXAMPLES

Loading from a file:
docker load -i my_image.tar

Loading from STDIN (redirecting from a file):
cat my_image.tar | docker load

Loading from STDIN, suppressing output:
cat my_image.tar | docker load -q

SEE ALSO

docker save(1), docker push(1), docker pull(1), docker build(1)

Copied to clipboard