简体   繁体   English

Virtualbox Docker-Machine“无效的卷规范”

[英]Virtualbox Docker-Machine "invalid volume specification"

I tried different ways to set the COMPOSE_CONVERT_WINDOWS_PATHS to 1, but I keep getting the following error:我尝试了不同的方法将COMPOSE_CONVERT_WINDOWS_PATHS设置为 1,但我不断收到以下错误:

ERROR: FOR docker_test Cannot create container for service test: 
invalid volume specification: 
'C:\Users\my_user\test\cert_file.pfx:/root/.aspnet/https/https_cert.pfx:ro'

I tried everything I could find online so far.到目前为止,我尝试了所有可以在网上找到的东西。 These are my settings.这些是我的设置。 Anyone who can spot the issue?谁能发现问题? I use Docker-toolbox instead of Docker for Windows on my Windows machine, because I use Virtualbox as well (and I cannot run VT-x and Hypervisor at the same time).我在我的 Windows 机器上使用 Docker-toolbox 而不是 Docker for Windows,因为我也使用 Virtualbox(并且我不能同时运行 VT-x 和 Hypervisor)。 I guess I keep getting this error, because I have to set this environment variable on a different place, perhaps.我想我一直收到这个错误,因为我可能必须在不同的地方设置这个环境变量。

Last part docker-compose.yml最后一部分 docker-compose.yml

   secrets:
      - source: cert
        target: /root/.aspnet/https/https_cert.pfx
secrets:
    cert:
        file: cert_file.pfx

config.yml ( /Users/my_user/.docker/machine/machines/default/config.json ) config.yml ( /Users/my_user/.docker/machine/machines/default/config.json )

HostOptions: {
    "Env": [
        "COMPOSE_CONVERT_WINDOWS_PATHS=1"
    ]
}

Powershell:电源外壳:

PS C:\> $env:COMPOSE_CONVERT_WINDOWS_PATHS=1

Anyone who can spot the issue?谁能发现问题?

The base images from Microsoft seem te have some issues with Docker Toolbox, see https://github.com/microsoft/DockerTools/issues/177#issuecomment-481332463 .来自 Microsoft 的基本映像似乎与 Docker Toolbox 存在一些问题,请参阅https://github.com/microsoft/DockerTools/issues/177#issuecomment-481332463 So these lines in docker-compose.yml to copy files to the container don't work:所以 docker-compose.yml 中将文件复制到容器的这些行不起作用:

   secrets:
      - source: cert
        target: /root/.aspnet/https/https_cert.pfx
secrets:
    cert:
        file: cert_file.pfx

The error is a bit unclear, cause you think the issue is COMPOSE_CONVERT_WINDOWS_PATHS which isn't.错误有点不清楚,因为您认为问题是COMPOSE_CONVERT_WINDOWS_PATHS而不是。

The solution to this problem is to replace the lines with a simple volume:这个问题的解决方案是用一个简单的卷替换这些行:

volumes:
    - ./cert_file.pfx:/root.aspnet/https/https_cert.pfx

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

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