incalculable-toothbrush-17758
09/29/2024, 9:34 PM<http://gcr.io|gcr.io>
. I've tracked this down pretty far but I can't seem to determine the cause without a lot more digging and wanted to check if anyone had a solution to the problem first. Specifically it seems that docker-credential-gcloud
freezes on execution within Pants requiring the tools and envvars recommended in the docs. I can however push directly using docker without issue.
I'll put more details in the thread to save everyone the glut of information.
SOLVED, see thread for details.incalculable-toothbrush-17758
09/29/2024, 9:38 PM[GLOBAL]
pants_version = "2.21.0"
...
[docker]
env_vars = ["DOCKER_CONFIG=%(env.HOME)s/.docker"]
build_args = ["GIT_COMMIT"]
default_repository = "myorg/{directory}"
tools = [
"docker-credential-gcloud",
"gcloud",
"dirname",
"readlink",
"python3",
"cut",
"sed",
"bash",
]
[docker.registries.gcr-io]
address = "gcr.io"
default = true
...
`BUILD`:
pex_binary(
name='app',
environment='linux',
...
)
docker_image(
name='docker',
image_tags=['{build_args.GIT_COMMIT}'],
instructions=[
'FROM python:3.12-slim',
'EXPOSE 8080',
'COPY project/app.pex /bin/app',
'ENTRYPOINT ["/usr/local/bin/python3.12", "/bin/app"]',
],
source=None,
dependencies=['project:app'],
build_platform=['linux/amd64'],
)
incalculable-toothbrush-17758
09/29/2024, 9:45 PMpants.toml
symlinked into the directory on `PATH`:
echo "<http://gcr.io|gcr.io>" | env -i PATH=/Users/nik/tmp/testing/docker-creds HOME=/Users/nik CLOUDSDK_PYTHON=/Users/nik/.pyenv/shims/python3 /bin/sh -x docker-credential-gcloud get
Which also freezes. I dug a little deeper and got to:
env -i PATH=/Users/nik/tmp/testing/docker-creds HOME=/Users/nik /Users/nik/.pyenv/shims/python3 -S /opt/homebrew/Caskroom/google-cloud-sdk/484.0.0/google-cloud-sdk/lib/gcloud.py auth docker-helper get
And again this also freezes. At this point I'm not sure I can get to the bottom of it without really digging into the gcloud
source code, as I've already loaded this into my IDE and I can't manage to reproduce there.incalculable-toothbrush-17758
09/29/2024, 9:46 PMincalculable-toothbrush-17758
09/29/2024, 10:01 PMexport CLOUDSDK_PYTHON="$(python3 -c 'import sys; print(sys.executable)')"
and putting CLOUDSDK_PYTHON
in [docker].env_vars
seemed to do the trick.happy-kitchen-89482
09/30/2024, 12:05 PMincalculable-toothbrush-17758
09/30/2024, 4:25 PMboundless-monitor-67068
01/10/2025, 2:46 PM