-
Notifications
You must be signed in to change notification settings - Fork 121
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
Docker Desktop on macOS with VirtioFS maps file permissions incorrectly #6812
Comments
@martingd Thanks for feedback. It's a file system limitation at the moment : if write permission is removed on a file, it can't be added back from the VM. Some containers in our test setup used to do that and other weird things. To mitigate this behavior, extended attributes are used to prevent removal of this permission on the host from containers. |
@fredericdalleau Thanks for the reply. The concrete use case where I ran into this problem is:
Now, this file cannot have its permissions changed. Example:
Looking into the host's filesystem, we see the file
Inside the container, I can still
|
Hi, to keep you posted, the issue is reproduced. It turns out tar uses a little bit different way to create a file on the host. There are multiple paths to fix it that are being discussed. As a workaround, you can extract your file in a volume and change the permissions there, and then move it on the share. |
@fredericdalleau A similar (the same) workaround is to extract the files in /tmp (in the container's filesystem), fix the permissions and then move it onto the share. Is a fix scheduled for this issue? |
@fredericdalleau any update on this ticket? |
Any updates on this? Looks like Docker is pushing for VirtioFS to be the default file sharing framework but as far as I know this issue has not been resolved. Thanks! |
Agreeing with Doug, this has not been resolved. I'm able to see this issue when running the following Pihole image:
Mapped directories work fine under osxfs and gRPC FUSE, but the software simply errors out when attempting to access the same files using VirtioFS. |
I can reproduce this issue even without using VirtioFS. |
Any updates on this issue? This is preventing me from using VirtioFS for some of the work I had to do where I need to use tar files. The script for extraction of the tar files are in another software package that I don't have access to modify the source. Hence, the suggested work around doesn't work for me. Instead, I need the docker to be able to extract the tar files with correct permissions to start with. As long as the osxfs is going to be supported indefinitely into the future, then that is okay for me. Otherwise, please help fix this issue. If you are are out of resources, then please point me at where to go look for the fix to this, and I will submit a pull request. |
We also have issues with VirtioFS. Not so sure if it's related with permissions or timestamps, but when we deploy EAR files, using a bind mount, the app server falls into an infinite deploy loop. The rest of the file sharing implementations (gRPC FUSE and osxfs) don't cause the issue. Fortunately. |
Another reproducible scenario is using restic I set up a test environment with the following structure:
I then successfully run
After which, the following command fails (worth noting it fails with or without the
and of course, all is fine when using gRPC FUSE. |
Just a note observing the same issue (in my case impacting ability to share a dir used by gpg agent) |
This seems to have the result that there are some tar archives that just can't be decompressed into a mounted directory at all. For example, the LLVM release tarballs. When I try to do:
I get a bunch of errors like:
Are there particular options to Using gRPC FUSE is not a usable workaround in our environment, because with that system sometimes a file can appear as zero-length when mounted into the container (see chanzuckerberg/miniwdl#461). |
When using VirtioFS to map files from the macOS host filesystem to a Docker container, permissions are not mapped correctly.
Expected behavior
When bind mounting the local macOS filesystem into a container instance I would expect files permissions (
rwx
) to be mapped correctly in the container. I would also expect it was possible to change permission on shared files inside the container and see that reflected in the macOS filesystem.Actual behavior
When using osxfx (legacy) sharing, things work as expected.
When using VirtioFS sharing, I see issues with permissions:
Information
Output of
/Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
Steps to reproduce the behavior
Using osxfx (legacy) sharing
If “osxfx (legacy)” is selected as file sharing implementation, permissions are mapped as expected.
We run a countainer, that maps the folder “macfs" into a container. Inside the container, we create files and manipulate them.
We start the container (in this case Debian Linux) and create two files:
Looking into the macOS host's filesystem we see the same permissions for the two files
In the container, we can change the permissions for file
a
:And we see it reflected in the macOS filesystem:
Using VirtioFS sharing
If “VirtioFS” is selected as file sharing implementation, files that are readonly on the macOS host's filesystem cannot have their permissions manipulated in the container.
After removing the files from the previous experiment and switching to “VirtioFS” sharing, we launch a new container instance and create the same two files:
The permissions look the same outside the container:
However, attempting to modify permissions for file
a
inside the container fails:Changing the permissions of file
b
is possible:However, The permissions for
b
has not changed outside the container:Please note that file
b
now has extended attributes set so we dump them:We can change
b
back inside the container:But if we remove
w
from fileb
in the host's filesystem:Then, this is not reflected inside the container:
Now, neither
a
norb
can have their permissions changed inside the container:However, we can still delete the files inside the container:
And, they are also deleted from the host filesystem:
The text was updated successfully, but these errors were encountered: