Skip to content

ECR docker login does not work anymore with docker image amazon/aws-cli:2.32.2 #9864

@b3n3d1k7

Description

@b3n3d1k7

Describe the bug

We have been using the amazon/aws latest image in our pipelines to push docker images to private ECR repositories using authorization token retrieved by aws ecr get-login-password.

With amazon/aws-cli:2.32.2 the docker login call fails with the error message: "400 Bad Request"
Reverting to amazon/aws-cli:2.32.1 fixes the issue.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Docker authentication using the AWS CLI docker image amazon/aws-cli:2.32.2 works as described here: https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html#registry-auth-token

Current Behavior

With amazon/aws-cli:2.32.2 the docker login call fails with the error message: "400 Bad Request"

Reproduction Steps

Run the command
aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com
with the docker image amazon/aws-cli:2.32.2

I.e.

docker run -t --env AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" --env AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}" --env AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}" --env AWS_SESSION_TOKEN="${AWS_SESSION_TOKEN}" amazon/aws-cli:2.32.2 ecr get-login-password --region "${AWS_DEFAULT_REGION}" | docker login --username AWS --password-stdin "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com"

Possible Solution

No response

Additional Information/Context

No response

CLI version used

aws-cli/2.32.2

Environment details (OS name and version, etc.)

ubuntu 24.04

Metadata

Metadata

Labels

bugThis issue is a bug.ecrp1This is a high priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions