rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
5.92k stars 280 forks source link

Windows/MSYS2 volume mount path conversion doesn't work #4380

Open ciarancourtney opened 1 year ago

ciarancourtney commented 1 year ago

Actual Behavior

The docker.exe bundled with rancher-desktop doesn't handle MSYS2 paths as volume mounts correctly, unlike docker-desktop, documented as working here https://docs.docker.com/desktop/troubleshoot/topics/#volumes:~:text=Path%20conversion%20on%20Windows

Steps to Reproduce

Run

docker run --rm -it -v /$PWD:/tmp alpine ls //tmp

or

MSYS_NO_PATHCONV=1 docker run --rm -it -v $PWD:/tmp alpine ls /tmp

from a Git Bash/MSYS2 terminal, and note no files are listed on rancher-desktop, but they are on docker-desktop.

This works on both docker and rancher-desktop:

docker run --rm -it -v $(pwd -W):/tmp alpine ls //tmp

-W arg to pwd outputs a C:\ style path.

Result

No files listed

Expected Behavior

File are listed, indicating volume mount worked

Additional Information

On latest git version 2.40.0.windows.1

Rancher Desktop Version

1.8.1

Rancher Desktop K8s Version

N/A

Which container engine are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

19044.2728

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

N/A

Windows User Only

Using Sonicwall, but shouldn't be relative

ciarancourtney commented 1 year ago

Found a workaround that works in v1.9.0-tech-preview, using the new syntax introduced in docker-cli v23.0 https://github.com/docker/cli/pull/3469

docker run --rm -it -v .:/tmp alpine ls //tmp