Virtualbox Docker-Machine "invalid volume specification"

395 views Asked by At

I tried different ways to set the COMPOSE_CONVERT_WINDOWS_PATHS to 1, but I keep getting the following error:

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). 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

   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)

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

Powershell:

PS C:\> $env:COMPOSE_CONVERT_WINDOWS_PATHS=1

Anyone who can spot the issue?

1

There are 1 answers

0
Erik van de Ven On BEST ANSWER

The base images from Microsoft seem te have some issues with Docker Toolbox, see 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:

   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.

The solution to this problem is to replace the lines with a simple volume:

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