windows - docker容器中的文件到底存储在宿主机的哪里

标签 windows docker kitematic

我在 Windows 上使用 docker。通过使用 kitematic,我创建了一个 ubuntu 容器。这个 ubuntu 镜像上安装了 postgresql。

想知道是否有可能从主机(Windows 机器)访问容器中可用的 postgres 配置文件?
容器到底将其文件系统存储在主机上的什么位置?
我希望它是 VMDK 格式的图像文件的一部分。
如果我错了,请纠正我。

最佳答案

Wondering if there is any possibility to access the postgres configuration files available in the container from the host (windows machine)

这不是 Docker 允许您修改容器中文件的方式。
为此,您应该在启动(docker run -v)容器时挂载主机(Windows)文件夹。
请参阅“Mount a host directory as a data volume

docker run -d -P --name web -v /c/Users/<myACcount>/src/webapp:/opt/webapp training/webapp python app.py

Issue 247提到 ~/Library/Application Support/Kitematic 用于应用程序数据,以及 ~/Kitematic“用于轻松访问卷数据”。

关于windows - docker容器中的文件到底存储在宿主机的哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39866898/

相关文章:

c++ - 对类方法的正确约定调用

docker - Docker的新功能-如何实质上进行可克隆的设置?

docker - Windows 10 docker kitematic安装错误

c++ - 如何获取适用于 Visual Studio 的 Boost 库二进制文件?

c++ - 如何确定阻塞的 SSL BIO 连接是否已关闭?

python - docker中的ngrok无法连接到Django开发服务器

linux - 此计算机未启用 VT-X/AMD-v

docker - 如何在Docker Hub上找到Docker镜像?

c - _beginthread 与 CreateThread

docker - Docker中的默认参数