英文:
open /Users/[user]/.docker/buildx/current: permission denied on macbook?
问题
我运行了命令docker compose up --build
,它正常运行,然后我尝试以sudo运行它一次。
自那以后,如果我不使用sudo,我会得到这个错误:
open /Users/[user]/.docker/buildx/current: permission denied
显然,有一个修复方法,即在运行命令之前设置DOCKER_BUILDKIT=0
,但我真的想要一个干净的解决方案。
我已经尝试重新启动我的笔记本电脑,删除Docker桌面(使用我在Stack Overflow上找到的卸载脚本,显然没有完全卸载一切)。但我仍然得到这个错误。
英文:
I ran the command docker compose up --build
and it ran normally, then I tried to run it with sudo once.
and since then if I don't use sudo I get this error:
open /Users/[user]/.docker/buildx/current: permission denied
Theres apparently a fix by setting DOCKER_BUILDKIT=0
before the command but I really want a clean solution.
I have tried restarting my laptop, deleting docker desktop (using an uninstall script I found on stack overflow that apprently didn't uninstall everything). And I still get that error
答案1
得分: 48
sudo chown -R $(whoami) ~/.docker
英文:
As comment by @emadpres, I am sharing here for mac user with auto detecting user:
sudo chown -R $(whoami) ~/.docker
答案2
得分: 8
如@lane.maxwell所评论的,您需要更新~/.docker
目录的所有者为您的用户名,使用以下命令:sudo chown -R [user] ~/.docker
(-R
: 递归执行更改以包括子目录)
英文:
As commented by @lane.maxwell, you need to update the owner of ~/.docker
directory to your username, using: sudo chown -R [user] ~/.docker
(-R
: perform the change recursively to subdirectories)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论