Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix authentication to ECR public #666

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

achille-roussel
Copy link

It appears that ECR public uses a different authentication mechanism than ECR, this PR make the docker provider compatible with both.

The following example highlights the issue, the provider uses Authorization: Basic on ECR public, but the API expects Authorization: Bearer:

TOKEN=$(aws --region us-east-1 ecr-public get-authorization-token | jq -r .authorizationData.authorizationToken)
curl -s -H "Authorization: Basic ${TOKEN}" https://public.ecr.aws/v2/docker/library/alpine/tags/list
{"errors":[{"code":"DENIED","message":"Your Authorization Token is invalid."}]}
curl -s -H "Authorization: Bearer ${TOKEN}" https://public.ecr.aws/v2/docker/library/alpine/tags/list
{"name":"docker/library/alpine","tags":["20240315","3.14.6","3.11.12","3.13.12","3.13","20240923", ...

Fixes #622

Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
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.

Error when pushing ECR public registry: unable to get digest: Got bad response from registry: 400 Bad Request
1 participant