login-action icon indicating copy to clipboard operation
login-action copied to clipboard

Public ECR login issue on Windows

Open crazy-max opened this issue 2 years ago • 1 comments

https://github.com/docker/login-action/actions/runs/5796019187/job/15708732154#step:3:14

image

Retrieving registries data through AWS SDK...
AWS Public ECR detected with us-east-1 region
Logging into public.ecr.aws...
Error: Error saving credentials: error storing credentials - err: exit status 1, out: `The stub received bad data.`

Looks similar to:

  • https://github.com/aws/aws-cli/issues/5636
  • https://github.com/docker/docker-credential-helpers/issues/190

crazy-max avatar Aug 08 '23 11:08 crazy-max

For anyone with this issue, make sure you are using windows-2022 runners

https://docs.aws.amazon.com/powershell/latest/reference/items/Get-ECRLoginCommand.html

...
      - name: Login AWS
        uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2

      - name: ECR
        run: |
            (Get-ECRLoginCommand).Password | docker login --username AWS --password-stdin accountid.dkr.ecr.region.amazonaws.com
          docker tag \
              "someimage/service:tag" \
              "accountid.dkr.ecr.region.amazonaws.com/service:tag"
          docker push "accountid.dkr.ecr.region.amazonaws.com/service:tag"
...

sbe-arg avatar Dec 18 '24 22:12 sbe-arg