Mac上的Boot2Docker - 访问本地文件 [英] Boot2Docker on Mac - Accessing Local Files
问题描述
截至2014年10月16日,Docker支持在/ Users路径中无缝安装目录。 p>
有了这个版本,我们正在解决最常见的问题:在Mac和容器之间共享目录。使用Docker 1.3与相应版本的boot2docker,主机挂载的卷现在按照您期望的方式工作。
...请注意,仍然存在一些限制:例如,此功能仅限于boot2docker的virtualbox配置,无法动态管理,仅适用于/ Users中的目录。但是我们正在收到令人兴奋的贡献,以改善音量管理,所以预计这个地区将在接下来的几个版本中大幅提升。
使用示例:
$ docker run -v / Users / bob / myapp / src:/ src [...]
I've just set up boot2docker on my Mac. How do I go about mounting a local directory on my Mac so that it's accessible all the way through to a running Docker container? Thanks for your help!
As of October 16, 2014, Docker supports mounting directories in the /Users path seamlessly.
From the Docker blog:
With this release we are addressing the most common issue: sharing directories between your Mac and your containers. Using Docker 1.3 with the corresponding version of boot2docker, host-mounted volumes now work the way you expect them to.
...Note that there are still some limitations: for example this feature is limited to boot2docker’s virtualbox configuration, cannot be managed dynamically, and only works for directories in /Users . But we are receiving exciting contributions to improve volume management, so expect this area to improve drastically in the next few releases.
Example usage:
$ docker run -v /Users/bob/myapp/src:/src [...]
这篇关于Mac上的Boot2Docker - 访问本地文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!