Skip to content

COMPOSE_CONVERT_WINDOWS_PATHS not working on v2 #9132

@blerins

Description

@blerins

Hello, I am having trouble to use docker-compose v2 on Windows without Docker Desktop with volumes. I have Docker installed on WSL2 (Ubuntu distro) with remote API enabled.

On Windows I am using Docker CLI with the DOCKER_HOST variable setted up.

Environment:

PS C:\Users\bruno.lerin\workspace\dc> cat .\docker-compose.yml
version: '3.6'

services:
  test:
    image: hello-world
    volumes:
      - ./:/test
PS C:\Users\bruno.lerin\workspace\dc> echo $Env:COMPOSE_CONVERT_WINDOWS_PATHS
1
PS C:\Users\bruno.lerin\workspace\dc> docker --version
Docker version 20.10.12, build e91ed57
PS C:\Users\bruno.lerin\workspace\dc> docker-compose config
services:
  test:
    image: hello-world
    volumes:
    - /c/Users/bruno.lerin/workspace/dc:/test:rw
version: '3.6'

PS C:\Users\bruno.lerin\workspace\dc> docker-compose2 config
services:
  test:
    image: hello-world
    networks:
      default: null
    volumes:
    - type: bind
      source: C:\Users\bruno.lerin\workspace\dc
      target: /test
      bind:
        create_host_path: true
networks:
  default:
    name: dc_default

Using docker-compose up on v2 is failing

PS C:\Users\bruno.lerin\workspace\dc> docker-compose2 -v
Docker Compose version v2.2.3
PS C:\Users\bruno.lerin\workspace\dc> docker-compose2 up
[+] Running 0/0
 - Container 4c1d77642ad3_dc_test_1  Recreate                                                                                                                                                        0.0s
Error response from daemon: invalid volume specification: 'C:\Users\bruno.lerin\workspace\dc:/test:rw'

While doing it so on v1 succeds

PS C:\Users\bruno.lerin\workspace\dc> docker-compose -v
docker-compose version 1.29.2, build 5becea4c
PS C:\Users\bruno.lerin\workspace\dc> docker-compose up
Starting 4c1d77642ad3_4c1d77642ad3_dc_test_1 ... done
Attaching to 4c1d77642ad3_4c1d77642ad3_dc_test_1
4c1d77642ad3_4c1d77642ad3_dc_test_1 |
4c1d77642ad3_4c1d77642ad3_dc_test_1 | Hello from Docker!
4c1d77642ad3_4c1d77642ad3_dc_test_1 | This message shows that your installation appears to be working correctly.
[...]
4c1d77642ad3_4c1d77642ad3_dc_test_1 |
4c1d77642ad3_4c1d77642ad3_dc_test_1 exited with code 0

In the config command we already see the issue with the mapped issue. I have been unable to find an altertanive for COMPOSE_CONVERT_WINDOWS_PATHS on v2.

If you need any further information, please let me know.

Kind regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions