soulzz
V2EX  ›  问与答

docker-compose volume 疑问

  •  
  •   soulzz · Dec 8, 2021 · 719 views
    This topic created in 1631 days ago, the information mentioned may be changed or developed.
    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
       Dec 8, 2021
    ok 解决了

    volumes:
    weblogs:
    external: true
    static_content:
    external: true
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5591 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 01:47 · PVG 09:47 · LAX 18:47 · JFK 21:47
    ♥ Do have faith in what you're doing.