V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
soulzz
V2EX  ›  问与答

docker-compose volume 疑问

  •  
  •   soulzz · 2021-12-08 16:49:06 +08:00 · 361 次点击
    这是一个创建于 875 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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

    我哪里写错了吗
    soulzz
        1
    soulzz  
    OP
       2021-12-08 17:07:42 +08:00
    ok 解决了

    volumes:
    weblogs:
    external: true
    static_content:
    external: true
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2288 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 60ms · UTC 03:55 · PVG 11:55 · LAX 20:55 · JFK 23:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.