简体   繁体   English

windows 上 docker-compose 的卷名问题

[英]Volume name issue with docker-compose on windows

I'm trying to start a multi containers applications for codeceptjs using docker-compose.我正在尝试使用 docker-compose 为 codeceptjs 启动一个多容器应用程序。 On linux the docker compose yml file works fine but on windows it fails complaining about "volume name is too short".在 linux 上,docker 撰写 yml 文件工作正常,但在 windows 上,它无法抱怨“卷名太短”。 Why docker compose complains on Windows?为什么 docker 撰写抱怨 Windows?

Here's the yml file content:这是 yml 文件内容:

version: '3.7'

services:
  hub:
    image: selenium/hub:latest
    [...]

  chrome:
    image: selenium/node-chrome:latest
    volumes:
      - /dev/shm:/dev/shm
    environment:
      [...]
    networks:
        test_network:
          ipv4_address: 10.2.0.3

  test-acceptance:
    image: test/codeceptjs
    [...]
    volumes:
      - $WORKSPACE:/tests
      - node_modules:/node_modules
    networks:
        test_network:
          ipv4_address: 10.2.0.5

volumes:
  node_modules:

networks:
    test_network:
      driver: bridge
      ipam:
        driver: default
        config:
          -
            subnet: 10.2.0.0/24

X X

Maybe it's just a typo but the offending values are probably here:也许这只是一个错字,但有问题的值可能在这里:

volumes:
  node_modules:

You need to put something after the colon.你需要在冒号后面放一些东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM