admin 管理员组文章数量: 1086019
I have an obscure situation where I need to bind mount to a directory /foo/bar:baz
inside a container.
Attempting something like this doesn't work because the :
is interpreted as something other than part of the directory name:
services:
foo:
image: ...
volumes:
- "./source:/foo/bar:baz"
I feel like I must be missing something obvious in the documentation about how to escape the :
, but can't find it.
I have an obscure situation where I need to bind mount to a directory /foo/bar:baz
inside a container.
Attempting something like this doesn't work because the :
is interpreted as something other than part of the directory name:
services:
foo:
image: ...
volumes:
- "./source:/foo/bar:baz"
I feel like I must be missing something obvious in the documentation about how to escape the :
, but can't find it.
- Re: the close vote. Is docker-compose not a programming question anymore? – Philip Couling Commented Mar 28 at 15:55
1 Answer
Reset to default 1There is a less used version of the syntax that allows services
to be a map instead of single string: https://github/compose-spec/compose-spec/blob/main/05-services.md#volumes
services:
foo:
image: ...
volumes:
- type: bind
source: ./source
target: /foo/bar:baz
本文标签: How to bind mount to a path containing a colon () in docker composeStack Overflow
版权声明:本文标题:How to bind mount to a path containing a colon (:) in docker compose - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744030520a2521413.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论