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

Multiple login with GCR and ACR #55

Open
VJalili opened this issue Mar 8, 2023 · 2 comments
Open

Multiple login with GCR and ACR #55

VJalili opened this issue Mar 8, 2023 · 2 comments

Comments

@VJalili
Copy link

VJalili commented Mar 8, 2023

Referring to logging in to multiple registries, does Azure docker login override Google docker login?

The following works as expected.

- name: Setup gcloud CLI
  uses: google-github-actions/setup-gcloud@v0.3.0
  with:
    project_id: ${{ secrets.GCP_PROJECT_ID }}
    service_account_key: ${{ secrets.GCP_SA_KEY }}

- name: Configure Docker using gcloud
  run: |
    gcloud auth configure-docker

- name: Hello world image
  run: |
    docker pull hello-world
    docker tag hello-world:latest us.gcr.io/my_registry/hello-world:test
    docker push us.gcr.io/my_registry/hello-world:test

If I add an Azure login as the following, it fails to authenticate to GCP with the following error message when pushing the image to a google container registry.

- name: Setup gcloud CLI
  uses: google-github-actions/setup-gcloud@v0.3.0
  with:
    project_id: ${{ secrets.GCP_PROJECT_ID }}
    service_account_key: ${{ secrets.GCP_SA_KEY }}

- name: Configure Docker using gcloud
  run: |
    gcloud auth configure-docker

- name: Azure login
  uses: azure/docker-login@v1
  with:
    login-server: ${{ secrets.AZ_CR }}
    username: ${{ secrets.AZ_USERNAME }}
    password: ${{ secrets.AZ_PASSWORD }}

- name: Hello world image
  run: |
    docker pull hello-world
    docker tag hello-world:latest us.gcr.io/my_registry/hello-world:test
    docker push us.gcr.io/my_registry/hello-world:test

unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication

@andre-lx
Copy link

andre-lx commented Sep 27, 2023

Same with EKS and ACR.

As a workaround, I'm using another action:

- name: Login to ACR
   uses: docker/login-action@v3
      with:
         registry: ${{ vars.ACR_SERVER }}
         username: ${{ secrets.ACR_USERNAME }}
         password: ${{ secrets.ACR_PASSWORD }}

@lgmorand
Copy link
Collaborator

EKS ? you mean ECR ?

The docker/login-action has a specific workaround code for ECR

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

No branches or pull requests

3 participants