简体   繁体   English

Docker Compose:卷无法在Windows Nano上运行

[英]Docker Compose: Volumes not working on Windows Nano

I've got two Windows Nano docker containers ... one with a service on, the second with my Automated Acceptance Tests. 我有两个Windows Nano docker容器...一个启用了服务,第二个进行了我的自动验收测试。

I'm trying to add a volume to the aat container so I can copy off the tests output. 我正在尝试向aat容器中添加一个卷,以便可以复制测试输出。

I've seen elsewhere I'm supposed to use ... 我看过其他地方我应该使用...

  • COMPOSE_CONVERT_WINDOWS_PATHS=1 COMPOSE_CONVERT_WINDOWS_PATHS = 1

But can't seem to get anywhere :S 但似乎无法到达任何地方:S

version: '3.3'

services:
  fancyservice:
    restart: always
    image: fancyservice
  aat-runner:
    environment:
      - FancyServiceUrl=http://fancyservice/
      - COMPOSE_CONVERT_WINDOWS_PATHS=1
    volumes:
      - .:/output:rw
    restart: always
    image: aat-runner

I get: 我得到:

ERROR: for aat_aat-runner_1  Cannot create container for service aat-runner: invalid volume spec "/output"

ERROR: for aat-runner  Cannot create container for service aat-runner: invalid volume spec "/output": invalid volume specification: '\output'
ERROR: Encountered errors while bringing up the project.

You have to specify the volume at the same level as "services:" as well as against the individual container ... 您必须在与“服务:”相同的级别上指定卷,并针对单个容器指定卷...

version: '3.3'

services:
  fancyservice:
    restart: always
    image: fancyservice
  aat-runner:
    environment:
      - FancyServiceUrl=http://fancyservice/
      - COMPOSE_CONVERT_WINDOWS_PATHS=1
    volumes:
      - .:/output:rw
    restart: always
    image: aat-runner
    volumes:
      - aat-output:c:\aat-output\

volumes:
  aat-output:

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

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