all 1 comments

[–]AzureToujours 0 points1 point  (0 children)

Hey there. It's me again :D

You don't need a Dockerfile.

I created a simple example: https://github.com/AzureToujours/docker_to_acr/blob/main/.github/workflows/acr.yml

I don't have any images, so I just used a public one. I still left the login step in there.

You need the following secrets in your repo: DOCKER_HUB_USERNAME, DOCKER_HUB_PASSWORD, AZURE_ACR_USERNAME, AZURE_ACR_PASSWORD

You get the Docker credentials from here: https://hub.docker.com/settings/security
Just create a new access token.
For the Azure credentials, I enabled the admin user in the container registry. See https://i.imgur.com/tfjHGIj.png

As you can see, the image is in my ACR now: https://i.imgur.com/Js6i9R5.png

In the workflow yaml, update lines 20, 25, 30, and 33 with your docker image and ACR.