Quickstart: Create a private 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, push a container image into the registry and finally deploy the container from your registry into Azure Container Instances (ACI).
Sign in to Azure
Sign in to the Azure portal at https://portal.azure.com.
Create a container registry
Select Create a resource > Containers > Container Registry.
Enter values for Registry name and Resource group. The registry name must be unique within Azure, and contain 5-50 alphanumeric characters. For this quickstart create a new resource group in the
West US location 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. Add a repository name such as
myrepo to place your image in a repository.
docker tag microsoft/aci-helloworld <login server>/<repository name>/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, and replace the repository name with the name of the repository you used in the previous command.
docker push <login server>/<repository name>/aci-helloworld:v1
Output from a successful
docker push command is similar to:
The push refers to repository [specificregistryname.azurecr.io/myrepo/aci-helloworld] 31ba1ebd9cf5: Pushed cd07853fe8be: Pushed 73f25249687f: Pushed d8fbd47558a8: Pushed 44ab46125c35: Pushed 5bef08742407: Pushed v1: digest: sha256:565dba8ce20ca1a311c2d9485089d7ddc935dd50140510050345a1b0ea4ffa6e size: 1576
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.
Deploy image to ACI
In order to deploy to an instance from the registry we need to navigate to the repository (aci-helloworld), and then click on the ellipsis next to v1.
A context menu will appear, select Run instance:
Fill in Container name, ensure the correct subscription is selected, select the existing Resource group: "myResourceGroup". Ensure that the "Public IP address" options is enabled by setting to Yes and then click OK to launch the Azure Container Instance.
When deployment starts a tile is placed on your portal dashboard indicating deployment progress. Once deployment completes, the tile is updated to show your new mycontainer container group.
Select the mycontainer container group to display the container group properties. Take note of the IP address of the container group, as well as the STATUS of the container.
View the application
Once the container is in the Running state, use your favorite browser to navigate to the IP address you noted in the previous step to display the application.
Clean up resources
To clean up your resources navigate to the myResourceGroup resource group in the portal. Once the resource group is loaded click on Delete resource group to remove the resource group, the Azure Container Registry, and all Azure Container Instances.
In this quickstart, you created an Azure Container Registry with the Azure CLI, and launched an instance of it via Azure Container Instances. Continue to the Azure Container Instances tutorial for a deeper look at ACI.