Docker load 命令参数详解和使用样例

本文记录docker load 命令各个参数的含义和使用样例。



docker load 参数

  • -i 从tar文件读取数据。 默认从标准输入
  • -q 减少输出内容
[root@vm249]# docker load --help

Usage:  docker load [OPTIONS]

Load an image from a tar archive or STDIN

  docker image load, docker load

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


[root@vm249]docker image ls

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

[root@vm249]docker load < busybox.tar.gz

Loaded image: busybox:latest
[root@vm249]docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
busybox             latest              769b9341d937        7 weeks ago         2.489 MB

-i --input string

[root@vm249]# docker load -i gcdw-operator-
071d8bd76517: Loading layer [==================================================>]  210.2MB/210.2MB
4bcb77274d4a: Loading layer [==================================================>]  312.8kB/312.8kB
03873a7977c3: Loading layer [==================================================>]  45.05MB/45.05MB
Loaded image:


[root@vm249]# docker load -i gcdw-operator-
Loaded image:
docker load -i



[root@vm249]# docker load -i saas-vsftpd-202304231128.tar -q
Loaded image:
[root@vm249]# docker image ls
REPOSITORY                        TAG         IMAGE ID       CREATED        SIZE
goharbor/redis-photon             v2.8.2      6f4498a430ca   3 weeks ago    121MB
goharbor/harbor-registryctl       v2.8.2      fa61a236a6d6   3 weeks ago    142MB
goharbor/registry-photon          v2.8.2      f80e71363231   3 weeks ago    79.3MB
goharbor/nginx-photon             v2.8.2      3d009028f260   3 weeks ago    120MB
goharbor/harbor-log               v2.8.2      2914d282d9bf   3 weeks ago    127MB
goharbor/harbor-jobservice        v2.8.2      40118f1568a8   3 weeks ago    141MB
goharbor/harbor-core              v2.8.2      0bbbd1f379fc   3 weeks ago    165MB
goharbor/harbor-portal            v2.8.2      3e74e0758aa4   3 weeks ago    127MB
goharbor/harbor-db                v2.8.2      5126635ae9f0   3 weeks ago    174MB
goharbor/prepare                  v2.8.2      eb3cf3cdd17a   3 weeks ago    163MB   ee81cf4b37cc   3 months ago   247MB          latest      007276d7208b   2 years ago    255MB