Use a container registry

Previous step: Introduction and prerequisites

In this step, you set up a suitable container registry for your app image. Container-capable hosting services like Azure App Service then pull the images from the registry.

This tutorial uses the Azure Container Registry (ACR), a private, secure, hosted registry for your images. The tools and processes shown here, however, also work with other registries like Docker Hub.

Create an Azure Container Registry

  1. Sign in to the Azure portal, then select Create a resource > Containers > Container Registry.

    Creating a container registry on the Azure portal

  2. In the Create container registry form that appears, enter appropriate values:

    • Registry name must be unique across Azure and contain 5-50 alphanumeric characters.
    • Select your subscription in Subscription.
    • Resource group needs to be unique only within your subscription.
    • In location, Location, selecting a region close to you.
    • Set Admin user as Enable.
    • Select Basic for SKU.

    Values for the container registry form

  3. Select Create to create the registry.

  4. Once the registry is created, open the notifications on the portal and select Go to Resource for the registry:

    Opening the newly created registry resource

  5. On the registry page, select Access Keys and note the admin credentials:

    Registry credentials for the registry on the Azure portal

  6. At a command prompt or terminal, log in to Docker using the command below, replacing <registry_name> with the name of your registry, and <username> and <password> from with the values shown in the Azure portal for the admin user:

    docker login <registry_name> -u <username> -p <password>
  7. In Visual Studio Code, open the Docker explorer and ensure that the registry endpoint that you just setup is visible under Registries:

    Verifying that the registry appears in the Docker explorer