rancher-desktop icon indicating copy to clipboard operation
rancher-desktop copied to clipboard

Bind-mounted non-existing folder does not get created on host when using -v option

Open SkyTrix opened this issue 4 months ago • 1 comments

Actual Behavior

When mounting a non-existing folder using the -v option, the target folder is created in the container, but not on the Docker host. According to https://docs.docker.com/engine/storage/bind-mounts/#differences-between--v-and---mount-behavior this should be the case. This works as expected when using Docker Desktop, but not when using Rancher Desktop.

Steps to Reproduce

Mount a non-existing folder using the -v option, e.g.: docker run -it -v /nonexisting:/hello busybox

  1. See that the hello folder is available in the container
  2. See that the nonexisting folder has not been created on the host

Result

The folder is created inside the container, but the counterpart on the Docker host is not.

Expected Behavior

Follow the behavior of Docker Desktop to create the empty folder on the host: https://docs.docker.com/engine/storage/bind-mounts/#differences-between--v-and---mount-behavior

Additional Information

No response

Rancher Desktop Version

1.16.0

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

Windows 10 22H2

What CPU architecture are you using?

x64

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

None

Windows User Only

No response

SkyTrix avatar Oct 09 '24 15:10 SkyTrix