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

docker-compose volume 疑问

  •  
  •   soulzz · 2021 年 12 月 8 日 · 650 次点击
    这是一个创建于 1594 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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 月 8 日
    ok 解决了

    volumes:
    weblogs:
    external: true
    static_content:
    external: true
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   945 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 21:50 · PVG 05:50 · LAX 14:50 · JFK 17:50
    ♥ Do have faith in what you're doing.