Is it possible to select repositories/create tags ...
# general
b
Is it possible to select repositories/create tags based on the enviroment or env variable? I would like to tag/push docker images different based on the environment e.g. on the local machine images should have a dev tag and/or be pushed to a certain repo and in the CI/CD pipeline the same images should be tagged/pushed differently.
e
You can use https://www.pantsbuild.org/prerelease/reference/build-file-symbols/env to reference environment variables in build files. So something like:
Copy code
docker_image(
    name="my_image"
    image_tags=[env("DOCKER_IMAGE_TAG", "default_tag")
    #other_args
)
will tag the image using the value in the
DOCKER_IMAGE_TAG
environment variable. If the environment variable is not set, the image will be tagged with
"default_tag"
gratitude thank you 1