https://pantsbuild.org/ logo
#general
Title
# general
w

worried-painter-31382

08/05/2022, 9:24 AM
Is there a less ugly way to tag all docker images of a specific image repo with environment variables than putting this in the config file?
Copy code
registries = """{
    'platform': {
        'address': "%(env.REGISTRY)s",
        'extra_image_tags': ["%(env.RESOLVED_PLATFORM_VERSION)s", "%(env.COMMIT)s"],
        'default': 'true',
    },
}"""
It doesnt seem like the other environment variable defaults suggested in https://www.pantsbuild.org/docs/tagging-docker-images works for the nested "registries" dictionary
h

happy-kitchen-89482

08/05/2022, 12:48 PM
Hmm, is the interpolation not happening, or is the env var not populated (so an empty string is interpolated)?
w

worried-painter-31382

08/05/2022, 12:49 PM
The former, eg:
Copy code
[docker.registries.local]
address = "<http://amramedical.com|amramedical.com>"
default = true
skip_push = true
extra_image_tags = ["%(env.RESOLVED_PLATFORM_VERSION)s"]
Will give the literal value
%(env.RESOLVED_PLATFORM_VERSION)s
as a tag
Also applies to
address
btw, so hence why I guessed the problem is the nesting of toml tables
I havent tested the "dictionary" like form of .toml tbf (
{ address = "%(env.BLARB)s" }
)
h

happy-kitchen-89482

08/05/2022, 2:25 PM
Hmm, I think this is a bug and we would expect this to work. Let me dig
w

worried-painter-31382

08/11/2022, 4:33 PM
Awesome!
4 Views