Windows 10 中的 docker 映像位置在哪里? [英] Where is docker image location in Windows 10?

查看:110
本文介绍了Windows 10 中的 docker 映像位置在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Windows 10 家庭版操作系统.我已经安装了 Docker 工具箱.

I'm using the Windows 10 Home operating system. I have installed Docker toolbox.

我使用以下命令创建了我的 .net 核心应用程序的 docker 映像.

I have created a docker image of my .net core application by using following command.

$  docker build -t helloWorld:core .

现在我想将此图像发送到另一台机器.但我没有得到图像文件.

Now I want to ship this image, to another machine. But I am not getting the image file.

谁能告诉我,我的图片会保存在哪里?或者有什么办法,在docker build命令中指定docker一个镜像路径.

Can someone please tell me, where my image will get saved? Or is there any way, to specify docker an image path in docker build command.

推荐答案

答案确实令人困惑,因为在 Windows 中运行 Docker 的方法不止一种.最新的方法是使用 Windows 10 Home 2020 年 5 月更新.它将使用新版本的 Windows 子系统 Linux (WSL2).这个答案是关于这个配置的.

The answers are really confusing because there is more than one way to run Docker in Windows. The newest way is with Windows 10 Home May 2020 Update. It will use the new version of Windows Subsystem for Linux (WSL2). This answer is about this configuration.

激活 WSL2 后,您将安装 Docker 桌面.Docker Desktop 是一个客户端,它将连接到 WSL 内的主机.

After activating WSL2, you'll install Docker Desktop. Docker Desktop is a client that'll connect to the host inside the WSL.

图片目录有点不一致.如果您在主机或 WSL 中运行 docker info,它将为您提供不存在的路径 Docker Root Dir:/var/lib/docker:

The image directory is somewhat inconsistent. If you run docker info in your host machine or inside WSL it will give you the path Docker Root Dir: /var/lib/docker which doesn't exist:

$ ls /var/lib/docker
ls: cannot access '/var/lib/docker': No such file or directory

您会在

/mnt/wsl/docker-desktop-data/

或在此 Windows 资源管理器路径中:

Or in this Windows Explorer path:

\wsl$docker-desktop-datamntwsldocker-desktop-datadatadockerimage

如果您使用的是 Windows 10 非家庭版,它的工作方式可能会有所不同.看看其他答案.由于我无法访问此操作系统,因此我不会尝试回答.

If you are using Windows 10 non-Home versions, it may work differently. Take a look at the other answers. Since I don't have access to this OS, I won't try to answer.

这篇关于Windows 10 中的 docker 映像位置在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆