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 don’t want a clean solution.
I have tried restarting my laptop, deleting docker desktop (using an uninstall script I found on stack overflow that apprently didnt uninstall everything). And I still get that error
2
Answers
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)As comment by @emadpres, I am sharing here for mac user with auto detecting user: