Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied. #10

Open
taitep opened this issue Oct 28, 2023 · 2 comments
Open

Permission denied. #10

taitep opened this issue Oct 28, 2023 · 2 comments

Comments

@taitep
Copy link

taitep commented Oct 28, 2023

Trying to run make build I get this error

docker build -t docker-aseprite .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=docker-aseprite&target=&ulimits=null&version=1": dial unix /var/run/docker.sock: connect: permission denied
make: *** [Makefile:14: build-image] Error 1

How do i fix this? The docker daemon was started with sudo dockerd from another terminal window.

@xackery
Copy link
Contributor

xackery commented Oct 29, 2023

https://docs.docker.com/engine/install/linux-postinstall/ Is good reading on the topic.

in summary,
the docker command is failing to connect to the socket, since current user doesn't have enough permissions.

There's a number of ways to resolve this:

Personally, I would work towards being able to run docker ps from current user, and that requires group/usermod noted on that article. This way, the built aseprite files are also generated as the current user. As the article notes, there are security considerations with this.

Alternatively, you can run docker as sudo, you can accomplish this by editing the Makefile and changing the line docker build noted last with the prefix sudo docker build, and it will prompt you for sudo access based on sudoers settings.

And lastly, that article also notes how you can run the docker daemen as a non-root user. I've never personally done this, but it may make sense depending on your use cas.e

Any of the 3 approaches above should resolve your issue.

Good luck!

@ilobilo
Copy link

ilobilo commented Jan 25, 2024

sudo usermod -a -G docker $USER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants