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

curved-farmer-66180

01/12/2023, 3:26 AM
Copy code
{build_args.REGISTRY}/$stg/$ecr_repository:$IMAGE_TAG +1 additional tag.
Error: 5.45 [ERROR] 1 Exception encountered:

  ProcessExecutionFailure: Process 'Building docker image {build_args.REGISTRY}/$stg/$ecr_repository:$IMAGE_TAG +1 additional tag.' failed with exit code 125.
stdout:

stderr:
invalid argument "{build_args.REGISTRY}/$stg/$ecr_repository:$IMAGE_TAG" for "-t, --tag" flag: invalid reference format
See 'docker build --help'.



Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
github action ci file
Copy code
run: |
          ./pants publish \
          --docker-build-args='[ \
            "DD_SERVICE=payhere-hero-cx", \
            "DD_ENV=stg", \
            "DD_VERSION=$IMAGE_TAG", \
            "IMAGE_TAG=$IMAGE_TAG", \
            "REGISTRY=$ECR_REGISTRY", \
            "REPOSITORY=$STG/$ECR_REPOSITORY", \
          ]' payhere/app_services/hero_cx:payhere_hero_cx
I got the error with invalid argument. I am using docker plugin. Is anybody able to help?
Copy code
docker_image(
    name="payhere_hero_cx",
    source="Dockerfile.hero_cx",
    repository="{build_args.REPOSITORY}",
    registries=["{build_args.REGISTRY}"],
    image_tags=["{build_args.IMAGE_TAG}", "latest"]
)
h

happy-kitchen-89482

01/12/2023, 3:30 AM
@curved-television-6568, thoughts? As far as I can tell the build args are defined correctly
c

curved-television-6568

01/12/2023, 4:40 AM
We really should detect when using placeholders on fields that doesn’t support it (this is the second time it has come up), and it is sneaky (or we should support placeholders for more fields).
registries
doesn’t support placeholders: https://www.pantsbuild.org/docs/reference-docker_image#coderegistriescode Every field that does has a paragraph that begins with:
<fieldname> may use placeholders in curly braces …
BUT, I don’t think we’ll need the placeholder syntax as much going forward, given the
env()
support for
BUILD
files in general: https://github.com/pantsbuild/pants/pull/17652
🎉 2
c

curved-farmer-66180

01/13/2023, 9:24 AM
Thanks @curved-television-6568 I will look for it!.
Copy code
docker_image(
    name="payhere_hero_cx",
    source="Dockerfile.hero_cx",
    repository="{build_args.REPOSITORY}",
    registries=[env("ECR_REPOSITORY_WITH_STAGE")],
    image_tags=["{build_args.IMAGE_TAG}", "latest"]
)
@curved-television-6568 It is not ready for pant 2.14 right?
c

curved-television-6568

01/13/2023, 2:13 PM
@curved-farmer-66180 no, it was just merged the other day, so it’s not in any release yet.
👍 1
4 Views