在简短的语法source:target:mode官方文档中只提到了ro和rw,但在cookiecutter template for django中他们使用了另外两种模式:z和Z,我在任何地方都没有找到任何关于他们的参考资料,它们是什么?
发布于 2021-07-09 21:32:58
-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是有用的。
https://stackoverflow.com/questions/68317294
复制相似问题