When trying to run `pants package`, I'm getting th...
# general
c
When trying to run
pants package
, I'm getting the following error:
Copy code
#3 [internal] load metadata for <http://docker.io/tensorflow/tensorflow:2.9.1-gpu|docker.io/tensorflow/tensorflow:2.9.1-gpu>
#3 sha256:8d3bd1ccb65ab89bd2786298e6e6e88a2a5e6f1a26f13dec1757448577beca32
Failed to fire hook: while creating logrus local file hook: user: Current requires cgo or $USER, $HOME set in environment
[2023-05-17T11:16:32.965266000Z][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 +0x1bc
#3 ERROR: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ``

[internal] load metadata for <http://docker.io/tensorflow/tensorflow:2.9.1-gpu|docker.io/tensorflow/tensorflow:2.9.1-gpu>:

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: ``
This happens for every docker image I'm trying to build, the tensorflow above is just an example. The corresponding
docker build
command to build the same works fine. How do I fix it? Thanks!
e
The error message is helpful if you know Pants is hermetic by default. When it runs processes it scrubs env vars (error message mentions 3 of those). Given that knowledge, I'll let you try your hand at https://pantsbuild.org. The docs are pretty good. If you can't figure it out from there, please speak up.
c
Naturally, I have tried setting USER and HOME env vars, I also made sure that sw_vers is in PATH and working.
e
I was terse @clever-father-91273 but sometimes we spoon feed too much and don't leverage all the work folks put into the doc site / teach people to fish. You were a random recipient of more of this style of help. I hope this has worked for you?
c
It has, thanks a lot!