dry-analyst-73584
10/02/2024, 6:12 PMpublish
as a command line argument. Is that a thing that is possible? pants publish --docker-registries=
was my best guess but I'm not having much luck plumbing though the dictionary it wants.broad-processor-92400
10/02/2024, 6:40 PM--docker-registries='{"name": {"address": "foo"}}'
to work... but maybe the nested dictionaries don't bring happiness to anyone.
If we can't get that to work, some alternatives might be:
⢠setting via DOCKER_REGISTRIES=...
env var
⢠setting via an extra .toml
file, e.g. PANTS_CONFIG_FILES=/path/to/pants.special-docker.toml
that just contains [docker.registries.$name] ...
entries
⢠having all registries in pants.toml
file at all times, but making it dynamic in BUILD
, e.g. a __defaults__(docker_image=dict(registries=[env("CUSTOM_REGISTRY", "original-provider"))
(https://www.pantsbuild.org/stable/docs/using-pants/key-concepts/targets-and-build-files#field-default-values) where something sets CUSTOM_REGISTRY=new-provider
env var (or some other way of conditionalising it)dry-analyst-73584
10/02/2024, 6:44 PM