Bind mounts do not work starting at 4.39.0
Description
bind mounts used to work, now they do not anymore. Very sure this release is the cause, because a co worker had the issue first, then to test I ran everything (no issues), updated docker, ran it again, had an issue. error log when doing docker compose up -d:
Error response from daemon: error while mounting volume '/var/lib/docker/volumes/e2e-test-volume/_data': failed to mount local volume: mount /Users/username/Projects/Testing/e2e-testing/target/test-results:/var/lib/docker/volumes/e2e-test-volume/_data, flags: 0x1000: no such file or directory
Reproduce
step 1: run the following command
docker volume create -o type=local -o o=bind -o device="/Users/username/Projects/Testing/e2e-testing/target/test-results" e2e-test-volume
step 2: docker compose up the following docker-compose.yml
---
services:
debug:
image: ubuntu
volumes:
- e2e-test-volume:/e2e-test-volume
volumes:
e2e-test-volume:
external: true
Expected behavior
should just start as expected
docker version
Client:
Version: 28.0.1
API version: 1.48
Go version: go1.23.6
Git commit: 068a01e
Built: Wed Feb 26 10:38:16 2025
OS/Arch: darwin/amd64
Context: desktop-linux
Server: Docker Desktop 4.39.0 (184744)
Engine:
Version: 28.0.1
API version: 1.48 (minimum version 1.24)
Go version: go1.23.6
Git commit: bbd0a17
Built: Wed Feb 26 10:41:16 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.25
GitCommit: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
runc:
Version: 1.2.4
GitCommit: v1.2.4-0-g6c52b3f
docker-init:
Version: 0.19.0
GitCommit: de40ad0
docker info
Client:
Version: 28.0.1
Context: desktop-linux
Debug Mode: false
Plugins:
ai: Docker AI Agent - Ask Gordon (Docker Inc.)
Version: v0.9.4
Path: /Users/username/.docker/cli-plugins/docker-ai
buildx: Docker Buildx (Docker Inc.)
Version: v0.21.1-desktop.2
Path: /Users/username/.docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.33.1-desktop.1
Path: /Users/username/.docker/cli-plugins/docker-compose
debug: Get a shell into any image or container (Docker Inc.)
Version: 0.0.38
Path: /Users/username/.docker/cli-plugins/docker-debug
desktop: Docker Desktop commands (Beta) (Docker Inc.)
Version: v0.1.5
Path: /Users/username/.docker/cli-plugins/docker-desktop
dev: Docker Dev Environments (Docker Inc.)
Version: v0.1.2
Path: /Users/username/.docker/cli-plugins/docker-dev
extension: Manages Docker extensions (Docker Inc.)
Version: v0.2.27
Path: /Users/username/.docker/cli-plugins/docker-extension
feedback: Provide feedback, right in your terminal! (Docker Inc.)
Version: v1.0.5
Path: /Users/username/.docker/cli-plugins/docker-feedback
init: Creates Docker-related starter files for your project (Docker Inc.)
Version: v1.4.0
Path: /Users/username/.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/username/.docker/cli-plugins/docker-sbom
scout: Docker Scout (Docker Inc.)
Version: v1.16.3
Path: /Users/username/.docker/cli-plugins/docker-scout
Server:
Containers: 14
Running: 11
Paused: 0
Stopped: 3
Images: 41
Server Version: 28.0.1
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: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
runc version: v1.2.4-0-g6c52b3f
init version: de40ad0
Security Options:
seccomp
Profile: unconfined
cgroupns
Kernel Version: 6.10.14-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 31.34GiB
Name: docker-desktop
ID: 7b969c69-3ba1-4d7d-8799-1d547d94fd53
Docker Root Dir: /var/lib/docker
Debug Mode: true
File Descriptors: 168
Goroutines: 150
System Time: 2025-03-13T14:56:19.044318571Z
EventsListeners: 16
HTTP Proxy: http.docker.internal:3128
HTTPS Proxy: http.docker.internal:3128
No Proxy: hubproxy.docker.internal
Labels:
com.docker.desktop.address=unix:///Users/username/Library/Containers/com.docker.docker/Data/docker-cli.sock
Experimental: false
Insecure Registries:
hubproxy.docker.internal:5555
::1/128
127.0.0.0/8
Live Restore Enabled: false
WARNING: daemon is not using the default seccomp profile
Diagnostics ID
F04FB5C5-E888-4F8C-8BA7-D4A793AA79CB/20250313145806
Additional Info
No response
🤔 wondering if the root cause might be the same as #7617?
I contected docker support, they offered two options that both individually fixed my issue:
- Create docker volume with the following command:
docker volume create --driver local --opt type=none --opt device=/Users/username/Projects/Testing/e2e-testing/target/test-results --opt o=bind e2e-test-volume - define volume in the docker compose in a different way:
services:
debug:
image: ubuntu
volumes:
- type: bind
source: /Users/username/Projects/Testing/e2e-testing/target/test-results
target: /e2e-test-volume
They did not specify if this offered solution is permanently required or if they will fix this regression
This regression is still present in the v4.40.0 release of Docker Desktop.
This regression is still present in the v4.40.0 release of Docker Desktop.
4.38 works fine, 4.39 started to fail. Confirmed not yet fixed in 4.40.
I've the same issue, rolling back to 4.38 fixed the issue for me.
In my case, this issue (which appeared in 4.39) manifests as volume declarations using environment variables to specify the device path no longer working. Replacing the Environment Variable with its value (an absolute path) allows the application to start, but is a significant regression in terms of maintainability of the stack specification.
Does not work after 4.38:
volumes:
db_root:
driver: local
driver_opts:
type: none
device: $STATE_ROOT/database
o: bind
Replacing $STATE_ROOT with its value works in 4.40:
volumes:
db_root:
driver: local
driver_opts:
type: none
device: /Users/fred/projects/example/state/database
o: bind
Still a problem in 4.41.1
We are working on a fix, if possible can you give a try to this development build and let us know if it solves the issue? https://desktop-stage.docker.com/mac/main/arm64/192140/Docker.dmg Thanks for your feedback!
We are working on a fix, if possible can you give a try to this development build and let us know if it solves the issue?
Yes, my docker compose works on 4.38, failed on 4.40 when I let it update, and works again once I installed 4.42 from the .dmg you linked. Hooray! \o/
@bsousaa, this development build indeed seems to fix https://github.com/docker/for-mac/issues/7617 as well. I'm currently having issues related to our cluster (also in 4.38 - so problem is on our side I think), but all pods are now starting as expected with the development build. So would say it is looking good! Thanks, good news starting into the weekend!
We are on track to ship this fix with the upcoming 4.42 release
Hi Docker Desktop 4.42.0 has been released, with a fix for this issue. So I'll be closing this. If th issue eprsist, please feel free to open a new issue.
For more information see Docker Desktop 4.42.0 release notes
I am still getting this error in 4.43.2
Warning Failed 1s (x8 over 78s) kubelet Error: stat /Users/munish.chouhan/.wave/build-workspace: no such file or directory