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

alert-dawn-51425

03/01/2023, 9:33 PM
Any pointers on having support publishing docker images to two different aws ecr's and having the authentication work properly. Ideally, I would like the BUILD to dictate where to publish (to dev and prod, or just dev).
e

enough-analyst-54434

03/01/2023, 9:47 PM
Does two separate pants.toml +
PANTS_CONFIG_FILES=this.one ./pants publish ...
work? I.E. The recommended general CI trick?
a

alert-dawn-51425

03/01/2023, 9:48 PM
I didn't want to have to trigger the publishes separately, while also then having to run a filter to determine the registry set on each
Some of the images to get published need to get published to both dev and prod while others will only get published to the dev registry
e

enough-analyst-54434

03/01/2023, 9:51 PM
a

alert-dawn-51425

03/01/2023, 9:52 PM
Yes, so we have two registries in our toml file, one named prod and one named dev. Then, we reference those in the docker image.
b

broad-processor-92400

03/01/2023, 9:52 PM
Is the issue you can't do something like
docker_image(..., registries = ["@dev", "@prod"], ...)
directly because publishing to dev needs a separate login to publishing to prod?
a

alert-dawn-51425

03/01/2023, 9:52 PM
Yes, Huon that is the issue I am trying to solve for.
b

broad-processor-92400

03/01/2023, 9:53 PM
Do you know if there's
docker
/ AWS commands that allow this outside of pants? (as in, is this a pants issue or is it deeper?)
a

alert-dawn-51425

03/01/2023, 9:55 PM
It looks like there is some hacks to get it to work. That was why I was wondering if anyone had any success with that.
e

enough-analyst-54434

03/01/2023, 9:56 PM
Not knowing anything about this, this example seems to imply Docker knows about mapping certain registries to certain auth providers: https://www.pantsbuild.org/docs/docker#docker-authentication
Copy code
{
  "credHelpers": {
    "europe-north1-docker.pkg.dev": "gcloud"
  }
}
4 Views