for-mac
for-mac copied to clipboard
Docker Engine unable to start when host path for File share is not available
Description
This took a long time for me to figure out:
If a File Share disappears on a macOS host because the drive was removed or the folder was deleted, the Docker Engine becomes unable to start and provides no error message or indication as to why.
I was going mad trying to figure out why it wouldn't start, I almost completely uninstalled Docker before I tried turning off literally all optional features and removing all the file share mounts in a final act of desperation.
Reproduce
-
Settings > Resources > File sharing > Virtual file shares > +
Add a file share mount on a removable drive or network mount (e.g./Volumes/USB-DRIVE
) - Quit Docker Desktop
- Remove/eject the external drive from your system (e.g.
Finder.app > USB-DRIVE > Eject
) - Open Docker Desktop
- It shows
Docker is starting...
but never actually starts, and the menubar indicates the engine is stopped. It stays stuck in this state with no details as to why it's failing to start. Restarting the engine or rebooting also doesn't help.
Expected behavior
It should just ignore that directory or present it as an empty volume with no files inside.
Imo it shouldn't prevent Docker from starting or even show any error message, as there are many situations where you may want to share a transient folder present from a network share or USB drive that's not always mounted, and having to remove/re-add it every time it appears/disappears would be very annoying.
Think about all the companies that have NFS/SMB shares or all the users that might want to use files on a USB drive that are only available at their office, but then they go home and Docker bricks itself when they're not available.
docker version
Client:
Cloud integration: v1.0.35+desktop.13
Version: 26.0.0
API version: 1.45
Go version: go1.21.8
Git commit: 2ae903e
Built: Wed Mar 20 15:14:46 2024
OS/Arch: darwin/arm64
Context: desktop-linux
Server: Docker Desktop 4.29.0 (145265)
Engine:
Version: 26.0.0
API version: 1.45 (minimum version 1.24)
Go version: go1.21.8
Git commit: 8b79278
Built: Wed Mar 20 15:18:02 2024
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.6.28
GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
docker info
Client:
Version: 26.0.0
Context: desktop-linux
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.13.1-desktop.1
Path: /Volumes/NVME/Users/squash/.docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.26.1-desktop.1
Path: /Volumes/NVME/Users/squash/.docker/cli-plugins/docker-compose
debug: Get a shell into any image or container. (Docker Inc.)
Version: 0.0.27
Path: /Volumes/NVME/Users/squash/.docker/cli-plugins/docker-debug
dev: Docker Dev Environments (Docker Inc.)
Version: v0.1.2
Path: /Volumes/NVME/Users/squash/.docker/cli-plugins/docker-dev
extension: Manages Docker extensions (Docker Inc.)
Version: v0.2.23
Path: /Volumes/NVME/Users/squash/.docker/cli-plugins/docker-extension
feedback: Provide feedback, right in your terminal! (Docker Inc.)
Version: v1.0.4
Path: /Volumes/NVME/Users/squash/.docker/cli-plugins/docker-feedback
init: Creates Docker-related starter files for your project (Docker Inc.)
Version: v1.1.0
Path: /Volumes/NVME/Users/squash/.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: /Volumes/NVME/Users/squash/.docker/cli-plugins/docker-sbom
scout: Docker Scout (Docker Inc.)
Version: v1.6.3
Path: /Volumes/NVME/Users/squash/.docker/cli-plugins/docker-scout
WARNING: Plugin "/Volumes/NVME/Users/squash/.docker/cli-plugins/docker-scan" is not valid: failed to fetch metadata: fork/exec /Volumes/NVME/Users/squash/.docker/cli-plugins/docker-scan: no such file or directory
Server:
Containers: 26
Running: 6
Paused: 0
Stopped: 20
Images: 34
Server Version: 26.0.0
Storage Driver: stargz
driver-type: io.containerd.snapshotter.v1
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
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
runc version: v1.1.12-0-g51d5e94
init version: de40ad0
Security Options:
seccomp
Profile: unconfined
cgroupns
Kernel Version: 6.6.22-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: aarch64
CPUs: 5
Total Memory: 7.755GiB
Name: docker-desktop
ID: db9bc8bc-f4d6-4bf1-9100-a88bf4292336
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:///Volumes/NVME/Users/squash/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
5EEC1A9A-F159-4A04-A241-E60E50C218B5/20240501001245
Additional Info
macOS 14.4.1 on M1 Apple Silicon
Possibly related:
- https://github.com/docker/for-mac/issues/7003
- https://github.com/docker/for-mac/issues/7105
- https://github.com/docker/for-mac/issues/7227
- https://github.com/docker/for-mac/issues/7234
- https://github.com/docker/for-mac/issues/7012
- https://github.com/docker/for-mac/issues/6759
- https://github.com/docker/for-mac/issues/5113
- https://github.com/docker/for-mac/issues/6135
- https://github.com/docker/for-mac/issues/6902
- https://github.com/docker/for-mac/issues/6713
- https://github.com/docker/for-mac/issues/6914#issuecomment-1633782520
- https://github.com/docker/for-mac/issues/6628#issuecomment-1473053256
- https://github.com/docker/for-mac/issues/6630
- https://github.com/docker/for-mac/issues/6649
- https://github.com/docker/for-mac/issues/3431#issuecomment-898960403
Any suggestion how to fix this issue?
I had to delete the docker config file where they're stored, I don't remember where it is at the moment but I can post back in a few weeks when I'm back near my work computer. I also recommend checking the other issues I linked for config file locations.