early-twilight-26336
06/28/2024, 2:54 AMbuild_args
interpolation inside the docker_image.secrets
field? I'm doing this:
docker_image(
...
image_tags=["{build_args.TAG}"],
secrets={
"gcp": "{build_args.GOOGLE_APPLICATION_CREDENTIALS}",
},
...
)
TAG
works, but not GOOGLE_APPLICATION_CREDENTIALS
. I do have both in [docker.build_args]
in pants.toml
. The docs sort of suggest it should work:
These are the common values available for all fields:https://www.pantsbuild.org/2.21/docs/docker/tagging-docker-images#string-interpolation-using-placeholder-values but maybe I'm reading it wrong.
early-twilight-26336
06/28/2024, 3:11 AMEngine traceback:
in `publish` goal
ProcessExecutionFailure: Process 'Building docker image <image>:<tag>' failed with exit code 1.
stdout:
stderr:
ERROR: failed to stat /runner/_work/<repo name>/<repo name>/{build_args.GOOGLE_APPLICATION_CREDENTIALS}: stat /runner/_work/<repo name>/<repo name>/{build_args.GOOGLE_APPLICATION_CREDENTIALS}: no such file or directory
curved-television-6568
06/29/2024, 6:25 AMsome fields of theso, your sentence ought to have read: "these are the common values available for all fields that support interpolation:"support replacing placeholder valuesdocker_image
curved-television-6568
06/29/2024, 6:30 AMenv()
var support in BUILD files could replace most uses of this interpolation feature.
https://www.pantsbuild.org/2.21/docs/using-pants/key-concepts/targets-and-build-files#environment-variablescurved-television-6568
06/29/2024, 6:31 AMimage_tags
does for instance: https://www.pantsbuild.org/2.21/reference/targets/docker_image#image_tagsearly-twilight-26336
07/02/2024, 1:30 PMenv
, that had slipped my notice. It should solve my problem nicely.