Building Docker Images: Using ACR Tasks

With this approach, we create a ACR Task (using Azure CLI), for which we pass parameters detailing:

  • Task Name
  • Dockerfile
  • Image name
  • Tag
  • Platform
  • Registry
  • Context (which is GIT Repo and branch)
  • Permission (PAT Token)

This is then set to trigger a build and save the resulting image to the repo.

Example below:

az acr task create --registry myregistry --platform windows --name build-release-branch --image mycustomimage:latest --context https://<github-url>#release --file Dockerfile --git-access-token $GIT_PAT

Note: This is the preferred approach to pushing images to the Private Azure Repository

Leave a Reply

Your email address will not be published. Required fields are marked *