-
Notifications
You must be signed in to change notification settings - Fork 120
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 mounts with shared mount propogation don't work #3431
Comments
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
/remove-lifecycle stale |
@segevfiner Hi. Did you fix this problem with |
I used the workaround described by the OP (using |
@lots0logs can you explain your solution? |
Hello everyone, |
Workaroundscreen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
mount --make-shared <mount_point>
# Ctrl-a Ctrl-\ You will need to do this on each Docker for Mac restart. |
/remove-lifecycle stale |
/lifecycle frozen |
Any chance to get a fix delivered on this one ? |
If using compose you can instantiate a small container image that makes the mount sharing work in the LinuxKit VM prior running the other containers. Below worked for me: ./shared-mount/Dockerfile
./docker-compose.yml
|
Trying to figure out how to do this. My result:
|
Reproduced in one line: docker run --rm -it -v /tmp:/mnt/tmp:shared alpine sh @segevfiner Re: Your workaround on Big Sur I get I believe this may be the root cause of k3d-io/k3d#366 Docker Desktop 2.5.0.1 |
Docker for Mac changed things so that tty file no longer works. Try this to get a shell into the machine instead: docker run -it --rm --privileged --pid=host justincormack/nsenter1 Might be enough then to just: mount --make-shared /tmp As that nsenter1 container might lend you in the docker daemon's namespace. |
I think this has resurfacced and not fixed yet in docker for mac. I can't use bind volumes on Mac. |
This issue also affects Docker for Windows, both inside WSL2 and outside. edit: For me, a workaround was to run |
Same issue for me today on WSL2, I tried @caugner workaround but it seems my path is not a valid mount point, does anyone have any other idea? edit: I disabled the experimental feature "use Docker Compose V2" of my docker desktop and it is good now |
For me, I had the issue even with that experimental feature was always disabled. Or they enabled it with an update, and disabled it again, without my interaction. PS: I ran |
I'm also looking to do a shared bind mount (to be able to capture source checkout and modifications from inside the container to the outside host) to no avail with almost every command / docker-compose combination here and in other resources on the web. |
I ran into this issue and the actual reason was trailing slash "/" at end of path. I removed it and no longer got the error message. Leaving here in case anyone else googles the error and ends up here |
Any change to be fixed? |
Expected behavior
The following works:
Actual behavior
It fails with the following error:
Information
This is due to the osxfs mounts inside the HyperKit VM being mounted with private mount propagation. Entering the VM with screen and changing that using
nsenter
andmount --make-shared
makes this work until you reboot the VM:nsenter -t $(pgrep docker-init) -m mount --make-shared /tmp
Diagnostic logs
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: