docker, devops,

Permission denied when using docker command in Docker Desktop for mac

Ngoc Ngoc Follow Oct 26, 2023 · 1 min read
Share this

Permission denied using docker command in mac

I was using Docker Desktop for mac with intel chip.
When I tried to build docker image, I faced error message below.
I was able to build image with sudo, but I couldn’t bear it.

ERROR: open /Users/user/.docker/buildx/activity/desktop-linux: permission denied

The error was due to the ownership of the docker folder. I guess somehow Docker Desktop install as root user.
I had to change the ownership from root to me to make it writable by me.
The following command have solved the problem.

sudo chown -R $(id -u):$(id -g) $HOME/.docker
Ngoc
Written by Ngoc Follow
Hi, I am ngoc, the Blog Editor of "Trending source", the the site you're currently previewing. I hope you like it!