[英]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
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 问题提供:
\\\\wsl$\\docker-desktop-data\\mnt\\wsl\\docker-desktop-data\\data\\docker\\volumes
\\\\wsl$\\docker-desktop-data\\mnt\\wsl\\docker-desktop-data\\data\\docker\\volumes
sudo ls /mnt/wsl/docker-desktop-data/data/docker/volumes
sudo 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.