From c71cf6a731189d79e5e2b56eba5d5fbd43502124 Mon Sep 17 00:00:00 2001 From: GameXG Date: Thu, 26 Nov 2015 22:41:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20compose=20=E4=BE=8B?= =?UTF-8?q?=E5=AD=90=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 数据卷相对路径必须以 . 或 .. 开头,否则会被认为是卷名称,由于存在 “/” 会提示:ERROR: haproxy/haproxy.cfg includes invalid characters for a local volume name, only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed 参考来源:https://docs.docker.com/compose/compose-file/ You can mount a relative path on the host, which will expand relative to the directory of the Compose configuration file being used. Relative paths should always begin with . or ... --- compose/usage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compose/usage.md b/compose/usage.md index 7238c21..c96d261 100644 --- a/compose/usage.md +++ b/compose/usage.md @@ -164,8 +164,8 @@ webc: haproxy: image: haproxy:latest volumes: - - haproxy:/haproxy-override - - haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro + - ./haproxy:/haproxy-override + - ./haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro links: - weba - webb