windows 如何从 tar 文件加载 Docker 镜像

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40582300/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:43:10  来源:igfitidea点击:

How to load a Docker image from a tar file

windowsdockerhortonworks-sandbox

提问by User Learning

I have installed Docker for Windows. I was given the task of working on Docker of HortonWorks Docker in Windows I don't know. I have downloaded HDP_2.5_docker.tar from here (http://hortonworks.com/downloads/#sandbox) which is 10 GB file.

我已经为 Windows 安装了 Docker。我的任务是在 Windows 中处理 HortonWorks Docker 的 Docker,我不知道。我已经从这里 ( http://hortonworks.com/downloads/#sandbox)下载了 HDP_2.5_docker.tar,它是 10 GB 的文件。

How can I load an image tar file? I have tried these commands in a cmd prompt:

如何加载图像 tar 文件?我在 cmd 提示符下尝试过这些命令:

E:\> docker import HDP_2.5_docker.tar

回答by VladoDemcak

You can use docker load

您可以使用 docker load

Usage:  docker load [OPTIONS]

Load an image from a tar archive or STDIN

Git bash console:

Git bash 控制台:

docker load < HDP_2.5_docker.tar

Windows cmd:

视窗命令:

docker load -i windowsservercore.tar

回答by Tuo Zhang

Firstly, put the tar file under your user folder: i.e: C:\Users\yourName\xxx.tar

首先,将 tar 文件放在您的用户文件夹下:即: C:\Users\yourName\xxx.tar

Secondly, run the Docker load CMD:

其次,运行Docker load CMD:

docker load -i xxx.tar

After it is done, we could see the file is loaded as Docker images by running CMD:

完成后,我们可以通过运行 CMD 看到文件被加载为 Docker 镜像:

docker images