for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

Docker not found when freshly installed on Mac

Open wibotwi opened this issue 2 years ago • 12 comments

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.

wibotwi avatar Apr 04 '23 15:04 wibotwi

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

linus-sh avatar Apr 06 '23 05:04 linus-sh

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"
}

unchidev avatar Apr 06 '23 16:04 unchidev

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.

wibotwi avatar Apr 14 '23 00:04 wibotwi

Try this?

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

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

Zhang-Siyang avatar Apr 27 '23 02:04 Zhang-Siyang

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 avatar May 13 '23 04:05 tekumara

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 avatar May 13 '23 04:05 tekumara

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.

tekumara avatar May 13 '23 05:05 tekumara

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.

kavithamadhavaraj avatar May 19 '23 11:05 kavithamadhavaraj

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...

WillPeak avatar Aug 17 '23 11:08 WillPeak

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.

susan06 avatar Oct 30 '23 19:10 susan06

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

juanmunoz00 avatar Mar 15 '24 20:03 juanmunoz00

i get the error of command not found: docker in my mac after installing the Docker desktop i follow these steps https://docs.docker.com/desktop/install/mac-install/

After running this command

sudo ln -s /Applications/Docker.app/Contents/Resources/bin/docker /usr/local/bin/docker error was resolved

sankhla2 avatar Sep 06 '24 11:09 sankhla2

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 also works for me. Quite weird that we need to do this. It seems docker will have problems every time if you just reinstall it on a mac.

MiladInk avatar Dec 07 '24 22:12 MiladInk

I was able to resolve this by clicking the troubleshoot icon (?) and then selecting "Uninstall". Then navigate to docker.com, login, and select "Launch Docker Desktop". It immediately brought up the "Finish setting up page" and resolved the problem.

pbrane avatar Sep 17 '25 19:09 pbrane