We're in the process of switching our docker regis...
# general
d
We're in the process of switching our docker registries from one cloud provider to another. For testing purposes it would be convenient to pass the registry name to
publish
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.
āœ… 1
b
Can you give an example of what you're trying and the errors? I'd expect something like
--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)
d
Ahh! I was missing the nesting in the registries dict. That does appear to be working šŸŽ‰
šŸŽ‰ 1