curved-pharmacist-95993
09/17/2024, 8:29 AMelegant-florist-94385
09/17/2024, 9:48 AMdocker_image(name="my_image", image_tags=["localtag"])
and then in CI, I just build the image with pants package path/to:image
, and then run docker image tag my_image:localtag $DYNAMIC_IMAGE_TAG
where $DYNAMIC_IMAGE_TAG
is the full tag including repo/image_name:tag
elegant-florist-94385
09/17/2024, 9:50 AMimage_tags=[env("LOCAL_TAG", "localtag")]
Now, your image will look for a LOCAL_TAG
environment variable, and use that, with a default fallback of "localtag"
• Use .pants.bootstrap
to dynamically prepare environment variables, and then use those with env
. See https://www.pantsbuild.org/blog/2024/04/27/simple-versioning-with-git-tagscurved-pharmacist-95993
09/17/2024, 10:37 AMelegant-florist-94385
09/17/2024, 10:46 AM