我在 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/