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

Amazon ECR Private login fails on Windows #125

Closed
Vlaaaaaaad opened this issue Dec 18, 2021 · 2 comments · Fixed by #126
Closed

Amazon ECR Private login fails on Windows #125

Vlaaaaaaad opened this issue Dec 18, 2021 · 2 comments · Fixed by #126
Labels

Comments

@Vlaaaaaaad
Copy link

Behaviour

Steps to reproduce this issue

  1. Create a GitHub Action workflow using windows-latest
  2. Try to use the docker/login-action@v1 action to login to an Amazon ECR Private repository
  3. Fail

Expected behaviour

Action should login with Amazon ECR Private.

Actual behaviour

Action fails with error: Unable to locate executable file: C:\Program. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.

Interestingly enough, using aws-actions/amazon-ecr-login works.

Configuration

name: App / Build and push

env:
  # In GitHub, go to Settings -> Secrets and set:
  #  AWS_ACCESS_KEY_ID to your own AWS Access Key ID, eg `AKIAIOSFODNN7EXAMPLE`
  #  AWS_SECRET_ACCESS_KEY to your own AWS Secret Access Key, eg `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`
  AWS_ECR_PRIVATE_ACCOUNT_ID: "355938773567"
  AWS_ECR_PRIVATE_REGION: "us-east-1"
  AWS_ECR_PRIVATE_REPO_NAME: "bug-docker-login-windows"

on:
  push:

jobs:
  windows:
    name: Amazon ECR Private - Windows
    runs-on: windows-latest

    steps:
      - name: Get the code
        uses: actions/checkout@v2.4.0

      - name: Login to Amazon ECR Private - FAILS
        continue-on-error: true
        uses: docker/login-action@v1
        with:
          registry: ${{ env.AWS_ECR_PRIVATE_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_ECR_PRIVATE_REGION }}.amazonaws.com
          username: ${{ secrets.AWS_ACCESS_KEY_ID }}
          password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v1.6.0
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: us-east-1

      - name: Login to Amazon ECR - WORKS
        uses: aws-actions/amazon-ecr-login@v1.3.3

Logs

GitHub Action logs from the linked run

@crazy-max
Copy link
Member

@Vlaaaaaaad #126 should fix your issue. You can try with:

      - name: Login to Amazon ECR Private
        uses: crazy-max/docker-login-action@aws-sdk
        with:
          registry: ${{ env.AWS_ECR_PRIVATE_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_ECR_PRIVATE_REGION }}.amazonaws.com
          username: ${{ secrets.AWS_ACCESS_KEY_ID }}
          password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

@Vlaaaaaaad
Copy link
Author

@crazy-max wow, you were fast!

Yup, I can confirm that code works! See https://github.com/Vlaaaaaaad/bug-docker-login-windows/runs/4576357893?check_suite_focus=true#step:3:14 for full logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants