running engine: waiting for the Docker API: context deadline exceeded
Description
running engine: waiting for the Docker API: context deadline exceeded
Reproduce
1 start the docker desktop for macos
Expected behavior
docker desktop for macos started
docker version
Client:
Version: 26.1.4
API version: 1.45
Go version: go1.21.11
Git commit: 5650f9b
Built: Wed Jun 5 11:26:02 2024
OS/Arch: darwin/amd64
Context: desktop-linux
Cannot connect to the Docker daemon at unix:///Users/snowdream/.docker/run/docker.sock. Is the docker daemon running?
docker info
docker info
Client:
Version: 26.1.4
Context: desktop-linux
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.14.1-desktop.1
Path: /Users/snowdream/.docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.27.1-desktop.1
Path: /Users/snowdream/.docker/cli-plugins/docker-compose
debug: Get a shell into any image or container (Docker Inc.)
Version: 0.0.32
Path: /Users/snowdream/.docker/cli-plugins/docker-debug
dev: Docker Dev Environments (Docker Inc.)
Version: v0.1.2
Path: /Users/snowdream/.docker/cli-plugins/docker-dev
extension: Manages Docker extensions (Docker Inc.)
Version: v0.2.24
Path: /Users/snowdream/.docker/cli-plugins/docker-extension
feedback: Provide feedback, right in your terminal! (Docker Inc.)
Version: v1.0.5
Path: /Users/snowdream/.docker/cli-plugins/docker-feedback
init: Creates Docker-related starter files for your project (Docker Inc.)
Version: v1.2.0
Path: /Users/snowdream/.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/snowdream/.docker/cli-plugins/docker-sbom
scout: Docker Scout (Docker Inc.)
Version: v1.9.3
Path: /Users/snowdream/.docker/cli-plugins/docker-scout
Server:
ERROR: Cannot connect to the Docker daemon at unix:///Users/snowdream/.docker/run/docker.sock. Is the docker daemon running?
errors pretty printing info
Diagnostics ID
F39A3D5A-DFC0-45CF-9F0D-7831FAAC3562/20240625231528
Additional Info
I also got this issue after upgrade.
I had to clean up everything inside .docker and uninstall socket_vmnet
I dont know which of those steps helped here.
Ok I found the issue, adding "insecure-registries" : [ "****", "****" ] to daemon.json makes it unable to start
It happened to me that I updated docker and when I booted up I got the same message.
I solved it by completely eliminating docker, here are the steps I followed to solve the problem.
Click Go > Go to Folder and navigate to the following folders. ~/Library/Application Support/Docker Desktop/ ~/Library/Caches/Docker Desktop/ ~/Library/Logs/Docker Desktop/ ~/Library/Preferences/com.docker.docker.plist ~/Library/Containers/com.docker.docker/ ~/Library/Saved Application State/com.electron.docker-frontend.savedState ~/.docker/
luck
@luisgagocasas you probably removed daemon.json with bad records like mine when you dropped .docker
Issue resolved when reverting back to v4.32 from release.
It happened to me that I updated docker and when I booted up I got the same message.
I solved it by completely eliminating docker, here are the steps I followed to solve the problem.
Click Go > Go to Folder and navigate to the following folders. ~/Library/Application Support/Docker Desktop/ ~/Library/Caches/Docker Desktop/ ~/Library/Logs/Docker Desktop/ ~/Library/Preferences/com.docker.docker.plist ~/Library/Containers/com.docker.docker/ ~/Library/Saved Application State/com.electron.docker-frontend.savedState ~/.docker/
luck
This worked for me, my steps:
- Uninstall Homebrew cask
- Delete all directories mentioned in @luisgagocasas' comment
- Install Homebrew cask
- Start Docker Desktop
- App will notify you to "Reapply configuration"
- Restart engine
Will uninstalling docker desktop also remove containers and volumes?
Will uninstalling docker desktop also remove containers and volumes?
@umair-me, yes this is a destructive solution. Deleting ~/Library/Containers/com.docker.docker/ as suggested in https://github.com/docker/for-mac/issues/7340#issuecomment-2195741371 will remove the VM that Docker uses to run on macOS which does contain all your containers and images. I'm unsure about volumes, but I typically mount local files on my Mac from outside of that VM which this solution shouldn't touch; e.g. I mount ~/Desktop/test/ to a container's ~/test directory. The test directory on my Mac's desktop wouldn't be touched by following @luisgagocasas' comment.
It happened to me when upgrading to 4.33. In addition, Docker froze after I clicked to get diagnostics.
I closed Docker Desktop and started it again and all looks working perfectly without doing anything additional.
Just remove .docker
Inside of Finder just click to Go -> Go to folder... -> Paste ~/.docker/ and remove it.
Experienced a similar issue on client 27.1.1 with Public Beta since updating the other day and trying to open Docker Desktop v4.33.0
Tried removing all suggested files and had perms issues. Only thing that solved it for me was:
- booting to recovery mode
- removing the containers folder,
- rebooting immediately after removing that, and opening Docker
- When Docker opened, it opened to the end of the installer.
rm -rf Library/Containers/com.docker.docker
This of course removed all my containers but allowed me to open Docker without crashing.
Example of info
docker info
Client:
Version: 27.1.1
Context: desktop-linux
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.16.1-desktop.1
Path: /Users/DynamicApproach/.docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.29.1-desktop.1
Path: /Users/DynamicApproach/.docker/cli-plugins/docker-compose
debug: Get a shell into any image or container (Docker Inc.)
Version: 0.0.34
Path: /Users/DynamicApproach/.docker/cli-plugins/docker-debug
desktop: Docker Desktop commands (Alpha) (Docker Inc.)
Version: v0.0.14
Path: /Users/DynamicApproach/.docker/cli-plugins/docker-desktop
dev: Docker Dev Environments (Docker Inc.)
Version: v0.1.2
Path: /Users/DynamicApproach/.docker/cli-plugins/docker-dev
extension: Manages Docker extensions (Docker Inc.)
Version: v0.2.25
Path: /Users/DynamicApproach/.docker/cli-plugins/docker-extension
feedback: Provide feedback, right in your terminal! (Docker Inc.)
Version: v1.0.5
Path: /Users/DynamicApproach/.docker/cli-plugins/docker-feedback
init: Creates Docker-related starter files for your project (Docker Inc.)
Version: v1.3.0
Path: /Users/DynamicApproach/.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/DynamicApproach/.docker/cli-plugins/docker-sbom
scout: Docker Scout (Docker Inc.)
Version: v1.11.0
Path: /Users/DynamicApproach/.docker/cli-plugins/docker-scout
Server:
ERROR: request returned Internal Server Error for API route and version http://%2FUsers%2FDynamicApproach%2F.docker%2Frun%2Fdocker.sock/v1.46/info, check if the server supports the requested API version
errors pretty printing info
May not be directly relevant though
For what it's worth— I tried every suggestion mentioned here and then some. The one that did the trick for me was
rm -rf ~/Library/Containers/com.docker.docker/
YMMV
Just remove
.dockerInside of Finder just click to Go -> Go to folder... -> Paste ~/.docker/ and remove it.
Great! Docker works again on my mac!
It happened to me that I updated docker and when I booted up I got the same message.
I solved it by completely eliminating docker, here are the steps I followed to solve the problem.
Click Go > Go to Folder and navigate to the following folders. ~/Library/Application Support/Docker Desktop/ ~/Library/Caches/Docker Desktop/ ~/Library/Logs/Docker Desktop/ ~/Library/Preferences/com.docker.docker.plist ~/Library/Containers/com.docker.docker/ ~/Library/Saved Application State/com.electron.docker-frontend.savedState ~/.docker/
luck
It works for me. Thanks!!!
Ok I found the issue, adding
"insecure-registries" : [ "****", "****" ]to daemon.json makes it unable to start
thanks i fixed by removing this "insecure-registries"
This worked for me:
-
rm -rf ~/.docker -
rm -rf Library/Containers/com.docker.docker
No need for restart nor starting in recovery mode though it deleted all my containers.
It happened to me that I updated docker and when I booted up I got the same message.
I solved it by completely eliminating docker, here are the steps I followed to solve the problem.
Click Go > Go to Folder and navigate to the following folders. ~/Library/Application Support/Docker Desktop/ ~/Library/Caches/Docker Desktop/ ~/Library/Logs/Docker Desktop/ ~/Library/Preferences/com.docker.docker.plist ~/Library/Containers/com.docker.docker/ ~/Library/Saved Application State/com.electron.docker-frontend.savedState ~/.docker/
luck
Although I don't know what caused it, I solved it by following the steps you mentioned. Hopefully, official developers will notice this as well, and it will really bother people who upgrade versions
~/.docker/
thanks,i resolved by your func,
After upgrading from 4.20 to 4.38 with Windows 11 over WSL, same message:
running engine: waiting for the Docker API: context deadline exceeded
After restarting the computer, it offers to recover WSL when starting Docker Desktop.
I accepted and all seems to work fine (no information lost)
You can try a lower version
"Reset to factory defaults" worked for me actually.
I got the same message after updating Docker, but simply turning Docker Desktop off and back on solved it for me.
macOS Sequoia (15.3.2)
Docker Desktop Version 4.39.0 (184744)
Engine: 28.0.1
Compose: v2.33.1-desktop.1
Credential Helper: v0.8.2
Kubernetes: v1.32.2
I renamed the ~/.docker/ folder to ~/.docker.old/ and Docker started immediately without a problem. All of my containers were still there and running.
Thanks to @DuMaM and @NarekPVP for the succinct solution.
I also got this issue after upgrade. I had to clean up everything inside
.dockerand uninstallsocket_vmnetI dont know which of those steps helped here.
Quiting Docker Desktop, running rm -rf ~/.docker and opening Docker Desktop again did the trick. Thanks all!
Isso funcionou para mim:
rm -rf ~/.dockerrm -rf Library/Containers/com.docker.dockerNão há necessidade de reiniciar nem iniciar no modo de recuperação, embora tenha excluído todos os meus contêineres.
It Solved