Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SkyTrix opened this issue Oct 9, 2024 · 1 comment
Labels
area/volume Access to host volumes from inside the VM or containers kind/bug Something isn't working triage/need-to-repro Needs to be reproduced by dev team

Comments

@SkyTrix
Copy link

SkyTrix commented Oct 9, 2024

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 SkyTrix added the kind/bug Something isn't working label Oct 9, 2024
@gunamata gunamata added area/volume Access to host volumes from inside the VM or containers triage/need-to-repro Needs to be reproduced by dev team labels Oct 9, 2024
@SkyTrix
Copy link
Author

SkyTrix commented Oct 10, 2024

Note that it only seems to be broken when running on WSL. When running on Windows from CMD, it still works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/volume Access to host volumes from inside the VM or containers kind/bug Something isn't working triage/need-to-repro Needs to be reproduced by dev team
Projects
None yet
Development

No branches or pull requests

2 participants