docker-compose volume 疑问

2021 年 12 月 8 日
 soulzz
windows11
docker desktop 最新版

docker-compsoe.yml 中指定了
手动在 docker desktop 中新建的的 volume 名称:static_content

services:
xxx:
container_name: web-api
image: xxx-web:0.1
volumes:
- weblogs:/home/java/logs
- static_content:/home/website/dist/Files
restart: always
ports:
- 8101:8101
volumes:
weblogs:
static_content:


启动后并没有按照预期使用我创建的 volume
而是使用了文件夹名称后加 static_content 的形式:xxxx_static_content

我哪里写错了吗
729 次点击
所在节点    问与答
1 条回复
soulzz
2021 年 12 月 8 日
ok 解决了

volumes:
weblogs:
external: true
static_content:
external: true

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://v2ex.xtra.eu.org/t/820908

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX