liveBook · Manning

ACR task

As explained in Learn Docker in a Month of Lunches, Second Edition

An ACR task is a managed Azure Container Registry build or automation job that executes image-related work in Azure.

An ACR task builds a container image in Azure from a local folder containing a Dockerfile and source code, then stores the result in Azure Container Registry. It resembles docker build, but uses Azure compute, so Docker does not need to be installed locally. section 14.2

Use an ACR task when you want to:

  • Offload image builds from a developer machine to Azure. section 14.2
  • Build images from different branches in parallel within a CI/CD workflow. section 14.2
  • Trade local Docker familiarity for a clean build agent on every task. section 14.2
cd ch14/exercises/hello-cloud-web
# build locally:
docker build -t diamol/ch14-web --quiet .
# and build the same image in ACR:
az acr build --image diamol/ch14-web --registry ${ACR_NAME} .
# you may get a TasksOperationsNotAllowed error if you're using
# free credits - if you do just import the image instead:
az acr import -n $ACR_NAME --source `
ghcr.io/diamol2e/ch14-hello-cloud-web -t diamol/ch14-web
# print the tag list for the new image repository:
az acr repository show-tags -n ${ACR_NAME} --repository diamol/ch14-web

Run a local Docker build beside an ACR build, then list the image tags stored in the registry. section 14.2

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Explains the build command, Azure execution, registry storage, and fresh-cache performance trade-off.
Examples
Compares local and ACR builds for an Alpine-based website image, then checks its registry tags.
What it assumes
Assumes a Dockerfile, source folder, Azure CLI, and an Azure Container Registry.
What you can do after
Apply via Azure CLI to build and push an image from a local source folder.
How it connects
Connects Docker build with Azure Container Registry, CI/CD pipelines, and Azure Container Instances.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.