Create a container registry using the Azure portal
An Azure container registry is a private Docker registry in Azure where you can store and manage your private Docker container images. In this quickstart, you create a container registry with the Azure portal.
Sign in to Azure
Sign in to the Azure portal at https://portal.azure.com.
Create a container registry
Select New > Containers > Azure Container Registry.
Enter values for Registry name and Resource group. The registry name must be unique within Azure, and contain 5-50 alphanumeric characters. Create a new resource group named
myResourceGroup, and for SKU, select 'Basic'. Select Create to deploy the ACR instance.
In this quickstart, we create a Basic registry. Azure Container Registry is available in several different SKUs, described briefly in the following table. For extended details on each, see Container registry SKUs.
|Basic||A cost-optimized entry point for developers learning about Azure Container Registry. Basic registries have the same programmatic capabilities as Standard and Premium (Azure Active Directory authentication integration, image deletion, and web hooks), however, there are size and usage constraints.|
|Standard||The Standard registry offers the same capabilities as Basic, but with increased storage limits and image throughput. Standard registries should satisfy the needs of most production scenarios.|
|Premium||Premium registries have higher limits on constraints, such as storage and concurrent operations, including enhanced storage capabilities to support high-volume scenarios. In addition to higher image throughput capacity, Premium adds features like geo-replication for managing a single registry across multiple regions, maintaining a network-close registry to each deployment.|
When the Deployment succeeded message appears, select the container registry in the portal, then select Access keys.
Under Admin user, select Enable. Take note of the following values:
- Login server
You use these values in the following steps while working with your registry with the Docker CLI.
Log in to ACR
Before pushing and pulling container images, you must log in to the ACR instance. To do so, use the docker login command. Replace the username, password, and login server values with those you noted in the previous step.
docker login --username <username> --password <password> <login server>
The command returns
Login Succeeded once completed. You might also see a security warning recommending the use of the
--password-stdin parameter. While its use is outside the scope of this article, we recommend following this best practice. See the docker login command reference for more information.
Push image to ACR
To push an image to your Azure Container Registry, you must first have an image. If needed, run the following command to pull an existing image from Docker Hub.
docker pull microsoft/aci-helloworld
Before you push the image to your registry, you must tag the image with the ACR login server name. Tag the image using the docker tag command. Replace login server with the login server name you recorded earlier.
docker tag microsoft/aci-helloworld <login server>/aci-helloworld:v1
Finally, use docker push to push the image to the ACR instance. Replace login server with the login server name of your ACR instance.
docker push <login server>/aci-helloworld:v1
Output from a successful
docker push command is similar to:
The push refers to a repository [uniqueregistryname.azurecr.io/aci-helloworld] 7c701b1aeecd: Pushed c4332f071aa2: Pushed 0607e25cc175: Pushed d8fbd47558a8: Pushed 44ab46125c35: Pushed 5bef08742407: Pushed v1: digest: sha256:f2867748615cc327d31c68b1172cc03c0544432717c4d2ba2c1c2d34b18c62ba size: 1577
List container images
To list the images in your ACR instance, navigate to your registry in the portal and select Repositories, then select the repository you created with
In this example, we select the aci-helloworld repository, and we can see the
v1-tagged image under TAGS.
Clean up resources
When no longer needed, delete the myResourceGroup resource group. Doing so will delete the resource group, ACR instance, and all container images.
In this quickstart, you created an Azure Container Registry with the Azure CLI. If you would like to use Azure Container Registry with Azure Container Instances, continue to the Azure Container Instances tutorial.