例如执行下面的 compose
version: '3.3' services: nginx: image: nginx volumes: - web_data/html:/usr/share/nginx/html - web_data/nginx:/var/log/nginx volumes: web_data:
就会出错,提示 failed to deploy a stack: service "nginx" refers to undefined volume web_data/html: invalid compose project
![]() | 1 Itoktsnhc 2023-06-13 17:05:44 +08:00 web_data:/html |
![]() | 2 moxuanyuan OP @Itoktsnhc 你没看清我说的是什么吧? |
![]() | 3 Kiza 2023-06-13 18:25:17 +08:00 via iPhone @moxuanyuan 路径用双引号包起来呢 |
4 cxtrinityy 2023-06-13 18:33:17 +08:00 via Android 我觉得你需要的是 bind mount 人不是 volume |
![]() | 5 moxuanyuan OP @cxtrinityy #4 我知道 bind 可以,但我想知为什么 volume 不能有子目录的概念。。这样不是更容易集中管理同一个容器的数据吗? |