docker load

Command Name: 

docker load

Description:

Load an image from a tar archive or STDIN.

Steps:

  1. Save tar from image
  2. Remove that image
  3. Load image from tar

Syntax:

easywhatis$ docker load --help

Usage: docker load [OPTIONS]

Load an image from a tar archive or STDIN

Options:
  -i, --input string   Read from tar archive file, instead of STDIN
  -q, --quiet          Suppress the load output
easywhatis$

Example:

easywhatis$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              ed21b7a8aee9        12 days ago         127MB
ubuntu              latest              4e5021d210f6        3 weeks ago         64.2MB
busybox             latest              83aa35aa1c79        4 weeks ago         1.22MB
easywhatis$ rm busybox.tar
easywhatis$ ls -lt
total 0
drwxr-xr-x  5 easywhatis  staff  160 Apr  5 13:12 myimage
easywhatis$ docker save busybox > busybox.tar
easywhatis$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

nginx               latest              ed21b7a8aee9        12 days ago         127MB
ubuntu              latest              4e5021d210f6        3 weeks ago         64.2MB
busybox             latest              83aa35aa1c79        4 weeks ago         1.22MB
easywhatis$ docker rmi busybox
Untagged: busybox:latest
Deleted: sha256:83aa35aa1c79e4b6957e018da6e322bfca92bf3b4696a211b42502543c242d6f
Deleted: sha256:a6d503001157aedc826853f9b67f26d35966221b158bff03849868ae4a821116
easywhatis$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              ed21b7a8aee9        12 days ago         127MB
ubuntu              latest              4e5021d210f6        3 weeks ago         64.2MB
easywhatis$ docker load -i busybox.tar
a6d503001157: Loading layer [==================================================>]  1.437MB/1.437MB
Loaded image: busybox:latest
easywhatis$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              ed21b7a8aee9        12 days ago         127MB
ubuntu              latest              4e5021d210f6        3 weeks ago         64.2MB
busybox             latest              83aa35aa1c79        4 weeks ago         1.22MB
easywhatis$