我已安装 docker 在没有连接到 Internet 的系统中运行图像 docker , 我不得不从 this 下载一个简单的图像和来自另一个系统。然后我将此图像放在我的离线系统中的以下路径中:C:\Users\Public\Documents\Hyper-V\Virtual hard disks 但是当我运行时 docker run hello-world 在 cmd 我看到这条消息:
Unable to find image 'hello-world:latest' locally
并尝试从 Internet 下载 hello-world 图像,但它没有与 Internet 的连接,因此它字段。现在我想知道我应该把我的图像放在哪里才能让 docker 看到?
Best Answer-推荐答案
您可以通过从可以访问互联网的任何其他机器导出 docker 图像,以简单的方式完成此操作,而无需弄乱文件夹:
在可以访问互联网的机器上拉图像。
$docker pull hello-world
将该图像保存到 .tar 文件中。
$ docker save --output hello-world.tar {your image name or ID}
将该文件复制到任何机器。 将 .tar 文件加载到 docker。
$docker load --input hello-world.tar
查看: https://docs.docker.com/engine/reference/commandline/image_save/ https://docs.docker.com/engine/reference/commandline/load/#examples
关于windows - 如何在不连接互联网的情况下运行 docker 镜像?,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/48125169/
|