What would be the best way to achieve the `publish...
# general
c
What would be the best way to achieve the
publish
Goal for
docker_image
to put a dynamic Tag, I have already have a Git Tag with
semver
accessible at this moment in my ci/cd, so if I have
1.2.3
, how could I publish to my repository using the same tag
1.2.3
?
c
h
You can set up a build args section in
pants.toml
like this
Copy code
[docker]
build_args = [
  "MY_DYNAMIC_TAG",
]
and then amend your build target like such
Copy code
docker_image(
    name="docker",
    repository="my_image_name",
    image_tags=["{build_args.MY_DYNAMIC_TAG}"],
)
c
and on runtime I can have the Environment Variable
MY_DYNAMIC_TAG=1.2.3
and this will forward
to the build and tag correctly
h
It will!
It will actually complain if that environment variable isn't set
c
Cool thanks!