ScanSkill

docker load

The command docker load load an image from a tar archive file(even if compressed with xz, gzip, bzip2) or STDIN. It restores images as well as tags.

Syntax

$ docker load [OPTIONS]

Here,

Options:

  • --input, -i → Read from the tar archive file, instead of STDIN
  • --quiet, or -q → Suppress the load output

Examples

First, run the following command to see images:

$ docker image ls

Load an archive file:

$ docker load < busybox.tar.gz

Loaded image: busybox:latest

Now, see the image list:

$ docker images

REPOSITORY                    TAG               IMAGE ID       CREATED         SIZE
busybox                       latest            e15c69f24177   8 days ago      2.58MB
  • Read from the tar archive file
$ docker load --input ubuntu.tar

Loaded image: ubuntu:latest

Loaded image: ubuntu:22.04

Loaded image: ubuntu:jammy

See the loaded images list:

$ docker images

REPOSITORY                    TAG               IMAGE ID       CREATED         SIZE
busybox                       latest            e15c69f24177   8 days ago      2.58MB
ubuntu                        latest            693efac53ebd   2 days ago      77.8MB
ubuntu                        22.04             d2e4e1f51132   2 days ago      77.8MB
ubuntu                        jammy             d2e4e1f51132   2 days ago      77.8MB
ubuntu                        kinetic           d2e4e1f51132   2 days ago      77.8MB

ss