Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"docker" command not working after homebrew cask install on M1 Mac

I have installed docker using brew install homebrew/cask/docker and varying other ways yet when I enter docker --version to check CLI this error pops up

"-bash: /opt/homebrew/bin/docker: No such file or directory"

What should I be doing differently?

I have tried both installing through a .dmg file as well as through homebrew using cask.

like image 773
Mason Chester Avatar asked Jan 27 '26 09:01

Mason Chester


1 Answers

You can remove the installation and run these commands:

rm -rf ~/Library/Group\ Containers/group.com.docker
rm -rf ~/Library/Containers/com.docker.docker
rm -rf ~/.docker

Then try to install docker again and it should work. The .docker directory must have been owned by the root user.

like image 179
dreambold Avatar answered Jan 28 '26 22:01

dreambold