Hi all, I’m having this error when trying to build...
# general
l
Hi all, I’m having this error when trying to build a docker image, although if I pull the image manually, the build just works, may be this a bug?
Copy code
./pants package bin/python/k2-cli
22:22:25.21 [INFO] Canceled: Building docker image k2cli-image:latest
22:22:26.30 [INFO] Completed: Building docker image k2cli-image:latest
22:22:26.30 [ERROR] 1 Exception encountered:

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

stderr:
#1 [internal] load build definition from Dockerfile
#1 sha256:4a8abd0980b879a832783129b636eeff325378e63c397e805a03006b28634618
#1 transferring dockerfile: 276B done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 sha256:fc552389e5436c35d97f01972fad8271931105a81c136e6441a7b201d03dc98f
#2 transferring context: 2B done
#2 DONE 0.0s

#3 [internal] load metadata for <http://docker.io/library/python:3.11-buster|docker.io/library/python:3.11-buster>
#3 sha256:e6addec88fd262c680555922caa4a8358267c255899efe3bfe496a8402ddc253
Failed to fire hook: while creating logrus local file hook: user: Current requires cgo or $USER, $HOME set in environment
[2023-02-08T21:22:26.287981000Z][docker-credential-desktop][F] get system info: exec: "sw_vers": executable file not found in $PATH
[goroutine 1 [running, locked to thread]:
[common/pkg/system.init.0()
[	common/pkg/system/os_info.go:32 +0x29d
#3 ERROR: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ``
------
 > [internal] load metadata for <http://docker.io/library/python:3.11-buster|docker.io/library/python:3.11-buster>:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ``



Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
a
Are you on Mac. I had to change my ~/.docker/config.json to have
credStore
instead of
credsStore
l
That did it @alert-dawn-51425! 🙏
b
Ooh. Is this tip in our docs?
l
Hi @busy-vase-39202 Didn’t see it in the docker section https://www.pantsbuild.org/docs/docker
a
It is somewhere, but would probably be a good idea to add to the docker page also.
b
Would you use the Suggest Edit button on the docker page to submit a helpful addition about that?
w
Is there a fix for this issue in the works? Restarting docker desktop changes the config file and you have to fix the
credStore
entry everytime.
🙏 1
a
Love when I find my exact error message already discussed! I found that deleting the
~/.docker/config.json
file, then restarting Docker Desktop, provided a more durable solution. This resulted in neither
credsStore
nor
credStore
key present in the config file. Completely unrelated to Pants, I also enjoyed a hanging Docker Desktop “”Starting the Docker Engine...” that required I update
~/Library/Group Containers/group.com.docker/settings.json
with
“filesharingDirectories”: []
. Hope that saves someone from hours of 🤦🏽