Permission denied.
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.
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!
sudo usermod -a -G docker $USER
first make sure to check docker daemon is running or not , can be done using sudo systemctl status docker is active then fin e else do sudo systemctl start docker after that run make with sudo permission sudo make build