So recently I ran into an issue doing cross compil...
# general
g
So recently I ran into an issue doing cross compilation for linux x86_64 on my M2 MacBook. So I decided to spin up an Ubuntu 22.04 x86_64 VM on EC2. Now I'm running into a new problem that I didn't anticipate which is docker daemon socket permission errors. I have added my local user account to the docker group and can successfully run
docker run hello-world
without root. Why can't I get docker builds to work as an unprivileged user when running
pants package
? I tried searching in Slack and couldn't find threads that matched this issue.
Copy code
15:50:32.76 [ERROR] 1 Exception encountered:

Engine traceback:
  in `package` goal

ProcessExecutionFailure: Process 'Building docker image docker:latest' failed with exit code 1.
stdout:

stderr:
ERROR: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied
Copy code
$ ls -lsa /var/run/docker.sock
0 srw-rw---- 1 root docker 0 Feb 28 00:15 /var/run/docker.sock
👀 1
Enabling
use_buildx
and deleting
~/.cache/pants
fixed the problem.
Copy code
[docker]
use_buildx = true
b
Thanks! I got the same issue and your comment unblocked me 🙂 I first added
use_buildx = true
and deleted the cache -> this solved the error message I had but I had a new error Then I removed the
use_buildx = true
and it worked. So it is probable that
buildx
had nothing to do with it, and the solution to my problem was just removing the cache