for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

Not able to add paths to latest Docker Desktop File Sharing on MacOS Monterey

Open sfreek76 opened this issue 11 months ago • 10 comments

Description

This bug may be similar to #7012

I can not add any new paths to latest docker Desktop on MacOS Monterey in Settings > Resources > Filesharing. After clicking the "Apply and restart"-Button the added paths in List disappear and docker does no save or restart at all. I tried to add the paths manually via the "settings.json" but with no luck.

Reproduce

1 Install Docker Desktop latest version for Mac (4.37.1) 2 Open Docker Desktop Settings and navigate to Resources > File Sharing 3 select the + and choose a folder 4 Hit apply and restart

Apply and restart just removes the added path and Docker Desktop Engine does no restart at all

Expected behavior

I would expect Docker Desktop to save my file path and allow me to mount volumes for a container

docker version

Version:           27.4.0
 API version:       1.47
 Go version:        go1.22.10
 Git commit:        bde2b89
 Built:             Sat Dec  7 10:35:43 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.37.1 (178610)
 Engine:
  Version:          27.4.0
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.10
  Git commit:       92a8393
  Built:            Sat Dec  7 10:38:33 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.7.21
  GitCommit:        472731909fa34bd7bc9c087e4c27943f9835f111
 runc:
  Version:          1.1.13
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Server: Docker Desktop 4.37.1 (178610)
 Engine:
  Version:          27.4.0
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.10
  Git commit:       92a8393
  Built:            Sat Dec  7 10:38:33 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.7.21
  GitCommit:        472731909fa34bd7bc9c087e4c27943f9835f111
 runc:
  Version:          1.1.13
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
sfreek@Shadowfax ~ % docker info
Client:
 Version:    27.4.0
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  ai: Ask Gordon - Docker Agent (Docker Inc.)
    Version:  v0.5.1
    Path:     /Users/sfreek/.docker/cli-plugins/docker-ai
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.19.2-desktop.1
    Path:     /Users/sfreek/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.31.0-desktop.2
    Path:     /Users/sfreek/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.37
    Path:     /Users/sfreek/.docker/cli-plugins/docker-debug
  desktop: Docker Desktop commands (Beta) (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/sfreek/.docker/cli-plugins/docker-desktop
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /Users/sfreek/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.27
    Path:     /Users/sfreek/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     /Users/sfreek/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.4.0
    Path:     /Users/sfreek/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/sfreek/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.15.1
    Path:     /Users/sfreek/.docker/cli-plugins/docker-scout

Server:
 Containers: 5
  Running: 3
  Paused: 0
  Stopped: 2
 Images: 12
 Server Version: 27.4.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 472731909fa34bd7bc9c087e4c27943f9835f111
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.10.14-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 1.927GiB
 Name: docker-desktop
 ID: 6b7130f1-bdd7-4b41-99ca-c57da94f939b
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Labels:
  com.docker.desktop.address=unix:///Users/sfreek/Library/Containers/com.docker.docker/Data/docker-cli.sock
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: daemon is not using the default seccomp profile

Diagnostics ID

43988214-2085-4E0D-8D38-FD559EB8D904/20250105123306

Additional Info

No response

sfreek76 avatar Jan 05 '25 12:01 sfreek76

Same for me Docker Desktop 4.37.2 (179585) Docker version 27.4.0, build bde2b89 macOS Sequoia 5.1.1 (24B91)

riethmue avatar Jan 25 '25 13:01 riethmue

It is likely that you are adding a path that is already shared at a parent level and Docker Desktop is silently discarding the new path. We will review and add a warning message to Desktop.

Please let me know if that is not the case.

bsousaa avatar Jan 30 '25 09:01 bsousaa

This is not the case for me.. for example i have /opt/pp/logs that was added previously.. now im trying to add /opt/pp/data and it does not work.. i also tried to add my home directory using the file browser and it did not work either

Docker Desktop 4.37.2 (179585) Docker version 27.3.1 macOS Sonoma 14.5

dcosio avatar Feb 06 '25 20:02 dcosio

same issue

Bhavya031 avatar Feb 09 '25 22:02 Bhavya031

same here

tomal214 avatar Feb 19 '25 20:02 tomal214

bump: same issue, latest build. When adding directories not present, they are removed on 'apply and restart'

And when launching a built image, it complains:

WARN[0000] /users/name/Docker/coordemo/i14y-csv/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion [+] Running 0/1 ⠋ Container i14y-csv-iris-1 Starting 0.0s Error response from daemon: Mounts denied: The path /users/name/Docker/coordemo/i14y-csv 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/desktop/settings/mac/#file-sharing for more info. (base) name@MacBook-Pro-2 i14y-csv %

Version

4.38.0 (181591)

Engine: 27.5.1

Compose: v2.32.4-desktop.1

Credential Helper: v0.8.2

Kubernetes: v1.31.4

pauljnorg avatar Feb 19 '25 22:02 pauljnorg

Same issue! Docker Desktop 4.39.0 (184744)

hassench avatar Mar 06 '25 12:03 hassench

It is likely that you are adding a path that is already shared at a parent level and Docker Desktop is silently discarding the new path. We will review and add a warning message to Desktop.

Please let me know if that is not the case.

Requoting this reply because it was the fix. In my case, I was adding a subdirectory in my home tree, not noticing that the top two pre-configured lines were /Users and /Volumes (which is...basically everything on your Mac). Docker Desktop could certainly give an error message explaining why the line disappears to help explain why.

This means you should configure your output as /Users/foo/bar/etc, it worked for me.

Raineer avatar Mar 08 '25 17:03 Raineer

Same issue here

gui-marra avatar Mar 21 '25 13:03 gui-marra

This is not the case for me.. for example i have /opt/pp/logs that was added previously.. now im trying to add /opt/pp/data and it does not work.. i also tried to add my home directory using the file browser and it did not work either

Docker Desktop 4.37.2 (179585) Docker version 27.3.1 macOS Sonoma 14.5

So I fixed my issue. I had to edit manually these files ~/Library/GroupContainersAlias/group.com.docker/settings.json and ~/Library/GroupContainersAlias/group.com.docker/settings-store.json to remove my old filesharess. I share on /opt/... After the edit I have "filesharingDirectories": [ "/Users", "/Volumes", "/opt", "/private", "/tmp" ]

/Users,/Volumes,/private and /tmp are there by default.. now my mounts work with this config

dcosio avatar Mar 25 '25 13:03 dcosio

I'm facing the same issue with the 4.35 and 4.39.

Editing manually ~/Library/Group\ Containers/group.com.docker/settings.json doesn't help.

As with everyone, docker desktop doesn't show the path in the GUI, and attempting to add it, result in the entry being removed when clicking the button Apply & Restart.

Adding a path outside the home directory works fine.

Note:

  • I granted Full Disk permission to Docker on MacOS security settings for testing. (Didn't solved the problem).

ocontant avatar Mar 30 '25 01:03 ocontant

Same issue

MorenoMdz avatar Apr 04 '25 14:04 MorenoMdz

Same here with 4.40

bartwalczak avatar Apr 13 '25 10:04 bartwalczak

For me, adding a directory leaves the "Apply & restart" button disabled on Desktop app (v4.40.0 (187762), macOS 15.4 (24E248)).

Restarting manually doesn't help, adding it to settings.json didn't help either. Editing settings.json seems to have no impact on the UI list of directories, even after fully quitting the Desktop app and relaunching.

Update:

  • Adding to both ~/Library/Group\ Containers/group.com.docker/settings-store.json and ~/Library/Group\ Containers/group.com.docker/settings.json worked. Not sure why my path wasn't GroupContainersAlias as above, but that's what worked for me.
  • The paths updated in Docker Desktop after (but reordered) completely restarting the desktop app.

ethanlee16 avatar Apr 19 '25 18:04 ethanlee16

Same issue here!

yanavdsande avatar May 14 '25 15:05 yanavdsande

Same in MacOS Sequoia 15.5. Docker Desktop 4.41.2 (191736) Docker version 28.1.1, build 4eba377

belkocik avatar May 18 '25 09:05 belkocik

same issue here, editing settings-store.json not working either

manikantareddygk avatar May 24 '25 11:05 manikantareddygk

Same issue in MacOS Sonoma 14.6.1

nate-morris avatar Jun 20 '25 18:06 nate-morris

I encountered the same issue when trying to mount a local folder into my container on macOS.

What finally worked for me:

  • Gave Docker full disk access in System Settings > Privacy & Security > Full Disk Access

  • Removed /Users from Docker Desktop’s "File Sharing" list (even though it’s there by default)

  • Added the full absolute path to my project manually (e.g. /Users/myname/projects/project_name/project_folder)

After applying everything worked as expected.

Hope this helps anyone facing the same mount denial issue.

jsm-shams avatar Jul 06 '25 22:07 jsm-shams

I added Docker to Full Disk Access in Systems Settings > Privacy & Security > Full Disk Access. This solved the issue for me. I had root directory in my Docker Desktop File Sharing.

mahnoorzaheer-14 avatar Oct 03 '25 11:10 mahnoorzaheer-14