Azure / Azure/docker-login

Multiple login with GCR and ACR

Open
#55 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
117
Forks
58
PR merge metrics
No merged PRs in 30d

Description

Referring to [logging in to multiple registries](https://github.com/Azure/docker-login#logging-in-to-multiple-registries), does Azure docker login override Google docker login?

The following works as expected.

```yml
- 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.

```yml
- 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.