I'm trying to create a container and push it to Azure Container Registry. I've created a container group and Service Principle, but I can't get docker push
to work.
> docker login azure --client-id 12345678-90ab-cdef-1234-567890abcdef --client-secret b1bb1ty~b0pp1ty_b00. --tenant-id 01234567-89ab-cdef-0123-456789abcdef
login succeeded
> docker push myrepo.azurecr.io/my_image
Using default tag: latest
The push refers to repository [myrepo.azurecr.io/my_image]
17e1b7f147c1: Preparing
7497d9224318: Preparing
4f70bf18a087: Preparing
f2a9a0445b79: Preparing
24d83d67379e: Preparing
45c2210a0dee: Waiting
5cb3a39200e1: Waiting
c203d67ebc1d: Waiting
281bff2725de: Waiting
unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.
The app associated with the Service Principle has the Owner role in the container group, so it should be able to do anything it wants, including pushing images, but I still get the error message above, and the link it contains doesn't say anything particularly useful on the subject. I've enabled diagnostic event logging on the container group, but my attempts generate no diagnostic information.
What more needs to be done before I'm able to successfully push an image to ACR?
CodePudding user response:
I think the problem has to do with how you performed your registry login.
As you can see either in Azure or Docker documentation, your docker login
command should look similar to the following:
docker login myrepo.azurecr.io \
--username <your service principal client id> \
--password <your service principal client secret>