简体   繁体   English

docker 和Windows一起使用时,镜像和容器存储在哪里?

[英]Where are docker images and containers stored when we use it with Windows?

NOTE: Am super new to both Windows and Docker注意:我对 Windows 和 Docker 都是超级新手

The tutorial I've been using says that they are under /var/lib/docker/containers if we're using Linux, but I can't seem to find that on my Windows machine.我一直在使用的教程说,如果我们使用 Linux,它们在/var/lib/docker/containers下,但我似乎无法在我的 Windows 机器上找到它。

Thanks!谢谢!

Things might have changed with Windows 10 Anniversary Update.随着 Windows 10 周年更新,情况可能有所改变。 I installed Docker from source here ( https://master.dockerproject.org/windows/amd64/docker-1.13.0-dev.zip ) as described here:我从这里的源代码安装了 Docker ( https://master.dockerproject.org/windows/amd64/docker-1.13.0-dev.zip ),如下所述:

https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start_windows_10 https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start_windows_10

Docker puts all of the images in this folder: Docker 将所有图像放在此文件夹中:

C:\ProgramData\docker\windowsfilter

and all containers in this folder:以及此文件夹中的所有容器:

C:\ProgramData\docker\containers

An easy way to check is to execute this:一个简单的检查方法是执行这个:

docker info

It should tell you where your files are stored:它应该告诉您文件的存储位置:

Containers: 2
 Running: 1
 Paused: 0
 Stopped: 1
Images: 10
Server Version: 1.13.0-dev
Storage Driver: windowsfilter
 Windows:
...
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
...

Enter docker-machine with输入 docker-machine

docker-machine ssh 

there you should find your containers.在那里你应该找到你的容器。

sudo ls /var/lib/docker/containers

After review some post on Stackoverflow and Google.在查看 Stackoverflow 和 Google 上的一些帖子后。 I found this directory :我找到了这个目录:

C:\ProgramData\Microsoft\Windows\Hyper-V

Here you can fin the configuration with the Virtual Machines在这里您可以使用虚拟机完成配置

C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines

Another important thing is the images are virtualized by the Hyper-V, so the info should be stored here.另一个重要的事情是图像被 Hyper-V 虚拟化,所以信息应该存储在这里。

C:\Users\Public\Documents\Hyper-V\Virtual hard disks

Update 2020 for WSL2 WSL2 更新 2020

If you're using this with WSL2, docker images will be maintained inside of your wsl drive available at \\\\wsl$\\ per this github issue :如果您在 WSL2 中使用它,docker 图像将保存在您的wsl 驱动器内,可在\\\\wsl$\\根据此github 问题提供

  • Windows : \\\\wsl$\\docker-desktop-data\\mnt\\wsl\\docker-desktop-data\\data\\docker\\volumes Windows : \\\\wsl$\\docker-desktop-data\\mnt\\wsl\\docker-desktop-data\\data\\docker\\volumes
  • Linux : sudo ls /mnt/wsl/docker-desktop-data/data/docker/volumes Linuxsudo ls /mnt/wsl/docker-desktop-data/data/docker/volumes

Docker installed on windows with docker toolbox(using virtual box in place of hyper-v) one VM is created on at C:\\Users\\YOURUSERNAME\\.docker\\machine\\machines with name default so you can find all VM files in default folder.使用 docker 工具箱安装在 Windows 上的 Docker(使用虚拟框代替 hyper-v)在C:\\Users\\YOURUSERNAME\\.docker\\machine\\machines了一个名为default VM,因此您可以在默认文件夹中找到所有 VM 文件.

you can connect this vm using您可以使用连接此虚拟机

docker-machine ssh

and you can find pulled images and container under this path (you may need to use sudo sometimes)并且您可以在此路径下找到拉取的图像和容器(有时您可能需要使用 sudo)

/var/lib/docker /var/lib/docker

I use WSL 2 and my images downloaded to next location: c:\Users<User>\AppData\Local\Docker\wsl\data我使用 WSL 2 并将图像下载到下一个位置:c:\Users<User>\AppData\Local\Docker\wsl\data
Hope it helps.希望能帮助到你。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows Server 2016上为Docker EE存储的映像在哪里,以及如何更改其位置? - Where are images stored for Docker EE on Windows Server 2016 and how do I change its location? 如何在Windows 2016下移动Docker映像的存储位置 - How do I move where Docker Images are stored under Windows 2016 Docker 镜像和容器位置与 Windows 10 使用 hyper-v - Docker images and containers location with Windows 10 using hyper-v Windows 10 上的 Docker:如何将现有容器和图像移动到新位置? - Docker on Windows 10: How to move existing containers & images to new location? Docker windows 容器中的塑料 - Plastic in Docker windows containers Docker 在哪里存储 Windows 10 上的图像文件? - Where Docker stores files of images on Windows 10? In Docker Desktop for windows 10 with WSL2, where does docker containers live &amp; how Linux containers can run a java app, but not windows nanoserver? - In Docker Desktop for windows 10 with WSL2, where does docker containers live & how Linux containers can run a java app, but not windows nanoserver? "Docker for Windows 容器环境变量" - Docker for Windows Containers environment variables 为什么删除 docker 容器和图像不会释放 Windows 上的存储空间? 如何解决? - Why removing docker containers and images does not free up storage space on Windows? How to fix it? Windows 10 上保存 docker 图像的默认位置 - Default location where docker images are saved on Windows 10
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM