docker / login-action

GitHub Action to login against a Docker registry
https://github.com/marketplace/actions/docker-login
Apache License 2.0
1k stars 181 forks source link

Support for azure/login@v2? #700

Open andrasg opened 2 months ago

andrasg commented 2 months ago

Description

I am trying to push to an Azure Container Registry using azure/login@v2.

I have successfully setup federated workload identities auth using: Configure a federated identity credential on an app

      - name: Azure login
        uses: azure/login@v2
        with:
          client-id: ${{ secrets.AZURE_CLIENT_ID }}
          tenant-id: ${{ secrets.AZURE_TENANT_ID }}
          subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

The above task successfully authenticates to Azure. I am unsure though how docker/login-action@v3 would be able to pick up the authenticated context. Is this supported? If not, would be a great addition.

nb: auth to ACR using username+password works great:

      - name: 'Docker login'
        uses: docker/login-action@v3
        with:
          registry: ${{ secrets.ACR_REGISTRY }}
          username: ${{ secrets.ACR_USERNAME }}
          password: ${{ secrets.ACR_PASSWORD }}
lgmorand commented 2 months ago

@andrasg are you using docker credentials (or SPN) ?

with docker admin credentials, I get

unauthorized: Application not registered with AAD.