首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Docker-compose volumes模式选项

Docker-compose volumes模式选项
EN

Stack Overflow用户
提问于 2021-07-09 21:04:23
回答 1查看 562关注 0票数 0

在简短的语法source:target:mode官方文档中只提到了rorw,但在cookiecutter template for django中他们使用了另外两种模式:zZ,我在任何地方都没有找到任何关于他们的参考资料,它们是什么?

EN

回答 1

Stack Overflow用户

发布于 2021-07-09 21:32:58

Docker run reference文档:

代码语言:javascript
复制
-v, --volume=[host-src:]container-dest[:<options>]: Bind mount a volume.
The comma-delimited `options` are [rw|ro], [z|Z],
[[r]shared|[r]slave|[r]private], and [nocopy].
The 'host-src' is an absolute path or a name value.

If neither 'rw' or 'ro' is specified then the volume is mounted in
read-write mode.

The `nocopy` mode is used to disable automatically copying the requested volume
path in the container to the volume storage location.
For named volumes, `copy` is the default mode. Copy modes are not supported
for bind-mounted volumes.

这些选项在(named) volume documentation (特别是ro)和bind mount documentation中有进一步的说明。

在实践中,我从来不需要这些选项中的任何一个,除非我碰巧部署到启用了SELinux的系统上,那么z是有用的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68317294

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档