Skip to content

feat: add docker-credential-ecr-login to image - #54

Merged
wpjunior merged 1 commit into
tsuru:mainfrom
guilhermebr:feature/ecr-credential-helper
Jul 30, 2026
Merged

feat: add docker-credential-ecr-login to image#54
wpjunior merged 1 commit into
tsuru:mainfrom
guilhermebr:feature/ecr-credential-helper

Conversation

@guilhermebr

Copy link
Copy Markdown
Member

Fixes #53.

Adds the amazon-ecr-credential-helper
(v0.12.0, current latest) to the image, mirroring the existing
docker-credential-gcr support. This enables buildkit pushes to Amazon ECR
using ambient AWS credentials (IRSA / instance profile) via the standard docker
credHelpers config:

{
  "credHelpers": {
    "123456789012.dkr.ecr.us-east-1.amazonaws.com": "ecr-login"
  }
}

Notes:

  • The binary comes from the official awslabs release bucket, which publishes
    linux-amd64 and linux-arm64 paths — matching ${TARGETARCH} directly,
    so both image platforms built by CI are covered. The build runs
    docker-credential-ecr-login -v as a sanity check, like the existing
    docker-credential-gcr version call.
  • Unlike the GCR block, this intentionally does not write a config.json
    at build time (gcr configure-docker has a fixed set of well-known hosts to
    register; ECR registry hosts are account/region-specific), so the
    credHelpers entry is left to the operator's mounted docker config.
  • Image pruning on ECR is a separate concern (ECR has no delete-on-manifest
    API compatible with the Distribution protocol); operators typically attach an
    ECR lifecycle policy to the repository prefix.

Validated in production: deploys on an EKS cluster pushing to ECR with IRSA
credentials and the credHelpers config above — pushes authenticate with no
static secrets.

Signed-off-by: Guilherme Rezende <guilhermebr@gmail.com>
@wpjunior
wpjunior merged commit b25cf8a into tsuru:main Jul 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image pushes to Amazon ECR fail with 401 Unauthorized — docker-credential-ecr-login not shipped in the image

3 participants