Create a Quick Task with Azure Container Registry
Azure Container Registry Quick Tasks offer you the ability to build and publish Docker images into your Azure Container Registry without requiring the Docker Engine running on your local machine, effectively providing a Docker in the cloud.
In this tutorial we will create an Azure Container Registry, then we will create a Quick Task using the Azure command line interface.
This content is available in video form on the Cloud Engineer Skills YouTube channel.
Creating an ACR Quick Task
Dockerfile
We will be using the following Dockerfile for building the image.
The Dockerfile contains just a single FROM statement which indicates that the Docker image we will build will use the hello-world container image from DockerHub as it’s base image.
1
FROM hello-world
Creating the Azure Container Registry
1
2
3
4
az login
az group create --name cloudengineerskills-acr-cli-rg --location eastus
az acr create --resource-group cloudengineerskills-acr-cli-rg --name cloudengineerskillscliacr --sku Basic
az acr repository list --name cloudengineerskillscliacr --output table
Building and Pushing the Container Image using the Azure CLI
1
az acr build --image hello-world:v1 --registry cloudengineerskillscliacr --file Dockerfile .
Verifying the Repository and Image have been added to the Registry
1
2
az acr repository list --name cloudengineerskillscliacr --output table
az acr run --registry cloudengineerskillscliacr --cmd 'cloudengineerskillscliacr.azurecr.io/hello-world:v1' /dev/null
Cleaning up the Resources
1
az group delete --resource-group cloudengineerskills-acr-cli-rg
This post is licensed under
CC BY 4.0
by the author.