You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doing some basic security hardening with a new Docker Desktop install, the first thing I did was remove each of the virtual file shares. Or so I thought. Imagine my surprise when the first docker instance I started was still able to write to my home folder!
As it turns out, an empty list is apparently interpreted as "share /Users, /Volumes, /private, /tmp, and /var/folders." The only way to avoid that behavior is to keep one entry in the list.
I'd like to know whose idea it was to enable this feature by default at all. Spectacularly insecure, dumb, defaults. I can also confirm this bug on macOS 26.5.1 with Docker Desktop v4.81.0. It is not possible to disable these ridiculous shares. I'd like to think whoever came up with this was summarily fired but at Docker that seems unlikely. I think 80% of users are probably unaware of this behavior and would rather it be off by default.
Edit: Workaround: You can remove everything but /tmp and it sticks. Presumably it requires one entry so you can point it at something empty. Confirmed this works. Now a malicious container can fill up my disk but at least it doesn't have full read+write access to more or less the entire of the machine.
I just tested on Docker for mac v4.94.0 and this issue seems to have been fixed recently?
I removed all the entries in Virtual file shares in Docker Desktop, and restarted Docker Desktop.
And now I havecat "$HOME/Library/Group Containers/group.com.docker/settings-store.json" | grep FilesharingDirectories returning "FilesharingDirectories": [],
And when I run docker run --rm --mount type=bind,source=/tmp,target=/probe debian ls -la /probe I have:
docker: Error response from daemon: mounts denied:
The path /tmp is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/go/mac-file-sharing/ for more info.
Run 'docker run --help' for more information
Activity
mdegans commentedon Jul 9, 2026
I'd like to know whose idea it was to enable this feature by default at all. Spectacularly insecure, dumb, defaults. I can also confirm this bug on macOS 26.5.1 with Docker Desktop v4.81.0. It is not possible to disable these ridiculous shares. I'd like to think whoever came up with this was summarily fired but at Docker that seems unlikely. I think 80% of users are probably unaware of this behavior and would rather it be off by default.
Edit: Workaround: You can remove everything but
/tmpand it sticks. Presumably it requires one entry so you can point it at something empty. Confirmed this works. Now a malicious container can fill up my disk but at least it doesn't have full read+write access to more or less the entire of the machine.ddadon10 commentedon Oct 7, 2026
I just tested on Docker for mac v4.94.0 and this issue seems to have been fixed recently?
I removed all the entries in Virtual file shares in Docker Desktop, and restarted Docker Desktop.
And now I have
cat "$HOME/Library/Group Containers/group.com.docker/settings-store.json" | grep FilesharingDirectoriesreturning"FilesharingDirectories": [],And when I run
docker run --rm --mount type=bind,source=/tmp,target=/probe debian ls -la /probeI have:Anybody else can reproduce the issue?