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
