Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Docker not found when freshly installed on Mac #6793

Open
wibotwi opened this issue Apr 4, 2023 · 11 comments
Open

Docker not found when freshly installed on Mac #6793

wibotwi opened this issue Apr 4, 2023 · 11 comments

Comments

@wibotwi
Copy link

wibotwi commented Apr 4, 2023

I downloaded Docker Desktop image for Mac. Opened the file and installed this app (drag n drop to the right).
Now I started Docker Desktop.
Inside it I click "set up and start simple example", it cloned some example git repo and then it failed with "docker command not found".

Am I missing something? Google suggested to add Docker Desktop application to PATH.
This is not mentioned in docker desktop installation guide. Where should I add this PATH?
I can add to my .zshrc, after that I am able to see docker command in console, but dosker desktop does not read my .zshrc and it still cannot find docker command.

@linus-sh
Copy link

linus-sh commented Apr 6, 2023

@wibotwi
Maybe this ?
https://docs.docker.com/desktop/mac/permission-requirements/#installing-symlinks

@unchidev
Copy link

unchidev commented Apr 6, 2023

I also encountered the same issue and resolved it with the following command.

ln -s /Applications/Docker.app/Contents/Resources/bin/docker /usr/local/bin/docker

sudo ln -s -f /Users/u/.docker/run/docker.sock /var/run/docker.sock

and change ~/.docker/config.json

{
        "auths": {},
-        "credsStore": "desktop",
+        "credStore": "desktop",
        "currentContext": "desktop-linux"
}

@wibotwi
Copy link
Author

wibotwi commented Apr 14, 2023

I did "chmod 755 /usr/locl/bin" and reinstalled docker desktop. No changes. I rebooted macbook. No changes.

Then I linked docker from my local Applications dir into /usr/local/bin/docker
Now it started complaining about different binary not found. So I went into Applications dir and linked all files into /usr/locl/bin.
And voila! Docker Desktop now works fine!

P.S.
I did not change credsStore to credStore in config.json. It still works. I am not sure why I need that.

@Zhang-Siyang
Copy link

Try this?

Docker Desktop -> Settings -> Advanced -> Choose System, not User -> Click [Apply & restart]

inspired by /docker/for-mac/issues/6793#issuecomment-1498510601

@tekumara
Copy link

tekumara commented May 13, 2023

Also have installed Docker Desktop 4.19 and no docker cli tool symlinks are present in /usr/local/bin or ~/.docker/bin

I have Advanced -> System checked:

CleanShot 2023-05-13 at 14 12 00@2x

In the logs I see:

2023-05-13 14:15:25.730544+1000  localhost com.docker.backend[72966]: symlinking CLI plugins
2023-05-13 14:15:25.732404+1000  localhost com.docker.backend[72966]: plugin docker-buildx is already installed
2023-05-13 14:15:25.735290+1000  localhost com.docker.backend[72966]: (CoreFoundation) [com.apple.defaults:User Defaults] found no value for key Proxies in CFPrefsSearchListSource<0x600000898200> (Domain: com.apple.SystemConfiguration, Container: (null))
2023-05-13 14:15:25.732518+1000  localhost com.docker.backend[72966]: updating vpnkit forwards with [{"protocol":"tcp","dst_prefix":"192.168.65.128/32","dst_port":3128,"path":"networkproxy.sock"}]
2023-05-13 14:15:25.794894+1000  localhost com.docker.backend[72966]: plugin docker-compose is already installed
2023-05-13 14:15:25.796183+1000  localhost com.docker.backend[72966]: plugin docker-dev is already installed
2023-05-13 14:15:25.796402+1000  localhost com.docker.backend[72966]: plugin docker-extension is already installed
2023-05-13 14:15:25.796610+1000  localhost com.docker.backend[72966]: plugin docker-init is already installed
2023-05-13 14:15:25.796807+1000  localhost com.docker.backend[72966]: plugin docker-sbom is already installed

Perms:

❯ ls -ald /usr/local/bin
drwxr-xr-x  16 tekumara  wheel  512 12 May 15:26 /usr/local/bin

@tekumara
Copy link

FYI - I installed Docker Desktop on a machine that previously had docker desktop installed. On first open, I was not presented with this Finish setting up Docker Desktop dialog:

Maybe that has something to do with it?

@tekumara
Copy link

To install the docker CLI symlinks into /usr/local/bin I did the following:

  1. Navigate to Settings -> Advanced

  2. Check User and Click Apply & Restart

  3. When osascript asks:

    Docker Desktop requires privileged access to apply configuration

    press Touch ID or enter your password.

  4. You'll see a "Background Items Added" notification with

    Software from "Docker Inc" added items that can run in the background. You can manage this in Login Items Settings.

    There are now symlinks for the CLI tools in ~/.docker/bin

  5. Check System and Click Apply & Restart.

    There are now symlinks in /usr/local/bin and ~/.docker/bin has been removed.

@kavithamadhavaraj
Copy link

I also had an older version installed already and didn't see the "Finish setting up page"

@tekumara's solution did the trick to me.
Set it to User, Apply & Restart, Set it to System, Apply & Restart.
Additionaly, I had to check Enable default Docker socket (Requires password) for the applications to start working.

@WillPeak
Copy link

Try this?

Docker Desktop -> Settings -> Advanced -> Choose System, not User -> Click [Apply & restart]

inspired by /docker/for-mac/issues/6793#issuecomment-1498510601

This worked for me...

@susan06
Copy link

susan06 commented Oct 30, 2023

I also had an older version installed already and didn't see the "Finish setting up page"

@tekumara's solution did the trick to me. Set it to User, Apply & Restart, Set it to System, Apply & Restart. Additionaly, I had to check Enable default Docker socket (Requires password) for the applications to start working.

this solution work for me, tz.

@juanmunoz00
Copy link

Try this?

Docker Desktop -> Settings -> Advanced -> Choose System, not User -> Click [Apply & restart]

inspired by /docker/for-mac/issues/6793#issuecomment-1498510601

This also worked for me!!

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants