Docker命令行参考(11) – docker load从tar归档文件或STDIN导入镜像

  1. Usage:  docker load [OPTIONS]
  2.  
  3. Load an image from a tar archive or STDIN
  4.  
  5. Options:
  6.       --help           Print usage
  7.   -i, --input string   Read from tar archive file, instead of STDIN.
  8.                        The tarball may be compressed with gzip, bzip, or xz
  9.   -q, --quiet          Suppress the load output but still outputs the imported images

docker load用来导入由docker save备份的镜像。

  1. $ docker images
  2. REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
  3. $ docker load < busybox.tar.gz
  4. # […]
  5. Loaded image: busybox:latest
  6. $ docker images
  7. REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
  8. busybox             latest              769b9341d937        7 weeks ago         2.489 MB
  9. $ docker load --input fedora.tar
  10. # […]
  11. Loaded image: fedora:rawhide
  12. # […]
  13. Loaded image: fedora:20
  14. # […]
  15. $ docker images
  16. REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
  17. busybox             latest              769b9341d937        7 weeks ago         2.489 MB
  18. fedora              rawhide             0d20aec6529d        7 weeks ago         387 MB
  19. fedora              20                  58394af37342        7 weeks ago         385.5 MB
  20. fedora              heisenbug           58394af37342        7 weeks ago         385.5 MB
  21. fedora              latest              58394af37342        7 weeks ago         385.5 MB
标签:Docker 发布于:2019-11-19 14:08:04