簡體   English   中英

windows 上 docker-compose 的卷名問題

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

我正在嘗試使用 docker-compose 為 codeceptjs 啟動一個多容器應用程序。 在 linux 上,docker 撰寫 yml 文件工作正常,但在 windows 上,它無法抱怨“卷名太短”。 為什么 docker 撰寫抱怨 Windows?

這是 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

也許這只是一個錯字,但有問題的值可能在這里:

volumes:
  node_modules:

你需要在冒號后面放一些東西。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM