使用 Docker 桌面运行 WSL 时,Docker 卷位于何处? [英] Where are Docker volumes located when running WSL using Docker Desktop?

查看:29
本文介绍了使用 Docker 桌面运行 WSL 时,Docker 卷位于何处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 Windows Subsystem Linux (WSL),Ubuntu 作为 Windows 10 下的客户端操作系统.现在我在 Windows 主机上安装了 Docker Desktop 并启用了 WSL 集成Docker 设置.到目前为止一切正常,我可以从我的 WSL Ubuntu 客户端访问在 Windows 主机上运行的 Docker 守护进程.

I am running Windows Subsystem Linux (WSL) with Ubuntu as client OS under Windows 10. Now I installed Docker Desktop on the Windows host and enabled the WSL integration in the Docker settings. That works fine so far, I can access the Docker daemon running on the Windows host from my WSL Ubuntu client.

现在我想知道所有 Docker 卷和其他数据在此设置中存储在哪里.通常这些位于 /var/lib/docker 下,但在使用 WSL 时似乎并非如此.运行 df -h 时,我可以看到以下与 Docker 相关的行:

Now I am wondering where all the Docker volumes and other data is stored in this setup. Usually these are under /var/lib/docker, but it seems when using WSL this is not the case. When running df -h I can see the following Docker-related lines:

/dev/sdd        251G  3.1G  236G   2% /mnt/wsl/docker-desktop-data/isocache
/dev/sdc        251G  120M  239G   1% /mnt/wsl/docker-desktop/shared-sockets
/dev/loop0      244M  244M     0 100% /mnt/wsl/docker-desktop/cli-tools

所以它们似乎在 Windows 主机上的某个地方.
...但在哪里?

So they are somewhere on the Windows host it seems.
... but where?

推荐答案

当我在docker中创建一个名为shared_data的卷时,我可以在

When I create a volume named shared_data in docker, I can find it under

\\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\shared_data\_data

\\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\shared_data\_data

这篇关于使用 Docker 桌面运行 WSL 时,Docker 卷位于何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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