Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

create dev environment failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock #6531

Closed
3 tasks done
yk12OT opened this issue Oct 22, 2022 · 8 comments
Closed
3 tasks done

Comments

@yk12OT
Copy link

yk12OT commented Oct 22, 2022

  • I have tried with the latest version of Docker Desktop
  • I have tried disabling enabled experimental features
  • I have uploaded Diagnostics
  • Diagnostics ID:
381A6EC0-CDDF-4E2C-B17D-096A55C0308A/20221022225005

Expected behavior

Expect to see no error when create new dev environment from local folder (or public github repo).

Actual behavior

Seeing error:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

P.S. Can this command just fine:

docker run -d -p 80:80 docker/getting-started

Information

  • macOS Version: Monterey 12.6 (21G115)
  • Intel chip or Apple chip: INTEL
  • Docker Desktop Version: 4.13.0 (89412)

Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

% /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check                  
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0014: are the backend processes running?
[PASS] DD0007: is the backend responding?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0012: is the VM networking working?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0019: is the com.docker.vmnetd process responding?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0032: do Docker networks overlap with host IPs?
No fatal errors detected.

Steps to reproduce the behavior

  1. uninstall docker desktop for macos
  2. install latest docker desktop 4.13.0 (89412)
  3. use all default settings
  4. try to 'create new dev environment' (does not matter if local folder or public github repo)
@yk12OT
Copy link
Author

yk12OT commented Oct 23, 2022

Workaround

  • uninstall docker desktop
  • do "deep cleanup" manually:
find ./Library -name "*docker*" 2> /dev/null 
...

rm -rf './Library/Application Support/com.bugsnag.Bugsnag/com.docker.docker'
rm -rf './Library/Application Support/com.bugsnag.Bugsnag/com.docker.docker/v1/KSCrashReports/Docker-CrashState.json'
rm -rf './Library/Preferences/com.electron.dockerdesktop.plist'
rm -rf './Library/Preferences/com.docker.docker.plist'
rm -rf './Library/Application Scripts/group.com.docker'
rm -rf './Library/HTTPStorages/com.docker.docker'
rm -rf './Library/Logs/Homebrew/docker'
rm -rf './Library/Group Containers/group.com.docker'
  • install older version of docker desktop (for example, 4.11.1)
  • create new dev environment to make sure it works with older version of docker desktop
  • upgrade docker to latest version

It's possible you would need to kill and re-create a dev environment (from folder or github), but it would still work...

@nicks
Copy link

nicks commented Oct 24, 2022

Thanks for the report! we're talking about this internally. We removed the /var/run symlink but dev environments was still using it. More discussion here: #6529

Another workaround is to manually create the symlink:

sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock

@nicks
Copy link

nicks commented Nov 2, 2022

This should be fixed in v4.13.1

@nicks nicks closed this as completed Nov 2, 2022
@matthinrichsen-wf
Copy link

matthinrichsen-wf commented Feb 14, 2023

I just updated to v4.16.2 and hit this issue.

sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock

The above did resolve the issue for me. But it appears that this regressed in v4.16.2.

@Surf-N-Code
Copy link

In version v4.16.2 the issue is appearing too.

@jonmelia
Copy link

Another for v4.16.2. As my Mac is managed by corporate, I can't add the symlink due to permissions issues so am currentl y unable to use.

@pixelchutes
Copy link

I was running into this on v4.14.x, v4.15.0, and v14.16.2 -- ended up identifying the following fix:

Check your ~/.docker/config.json file for a currentContext key. e.g. "currentContext": "desktop-linux"

In my case, removing currentContext from config.json did the trick!

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked

@docker docker locked and limited conversation to collaborators Apr 6, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

7 participants