skip to Main Content

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


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

    Login or Signup to reply.
  2. As comment by @emadpres, I am sharing here for mac user with auto detecting user:

    sudo chown -R $(whoami) ~/.docker
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search