在 Azure 门户中查看容器注册表存储库View container registry repositories in the Azure portal

使用 Azure 容器注册表可将 Docker 容器映像存储在存储库中。Azure Container Registry allows you to store Docker container images in repositories. 通过将映像存储在存储库中,可以将映像组(或映像版本)存储在隔离环境中。By storing images in repositories, you can store groups of images (or versions of images) in isolated environments. 将映像推送到注册表时,可以指定这些存储库,并可在 Azure 门户中查看其内容。You can specify these repositories when you push images to your registry, and view their contents in the Azure portal.

先决条件Prerequisites

  • 容器注册表:在 Azure 订阅中创建容器注册表。Container registry: Create a container registry in your Azure subscription. 例如,使用 Azure 门户Azure CLIFor example, use the Azure portal or the Azure CLI.
  • Docker CLI:在本地计算机上安装 Docker,该工具可为你提供 Docker 命令行接口。Docker CLI: Install Docker on your local machine, which provides you with the Docker command-line interface.
  • 容器映像:将映像推送到容器注册表。Container image: Push an image to your container registry. 有关如何推送和拉取映像的指南,请参阅推送和拉取映像For guidance on how to push and pull images, see Push and pull an image.

在 Azure 门户中查看存储库View repositories in Azure portal

在 Azure 门户中可以查看承载映像以及映像标记的存储库的列表。You can see a list of the repositories hosting your images, as well as the image tags, in the Azure portal.

如果已按照推送和拉取映像中的步骤操作(且随后未删除映像),则应在容器注册表中有一个 Nginx 映像。If you followed the steps in Push and pull an image (and didn't subsequently delete the image), you should have an Nginx image in your container registry. 该文中的说明指定使用命名空间(/samples/nginx 中的“samples”)标记映像。The instructions in that article specified that you tag the image with a namespace, the "samples" in /samples/nginx. 该文中指定的 docker push 命令(作为刷新程序)如下所示:As a refresher, the docker push command specified in that article was:

docker push myregistry.azurecr.cn/samples/nginx

由于 Azure 容器注册表支持此类多级存储库命名空间,因此可以将与特定应用或应用集合相关的映像集合的范围限制为不同的开发或运营团队。Because Azure Container Registry supports such multilevel repository namespaces, you can scope collections of images related to a specific app, or a collection of apps, to different development or operational teams. 若要详细了解容器注册表中的存储库,请参阅 Azure 中的专用 Docker 容器注册表To read more about repositories in container registries, see Private Docker container registries in Azure.

若要查看存储库,请执行以下操作:To view a repository:

  1. 登录到 Azure 门户Sign in to the Azure portal
  2. 选择向其推送了 Nginx 映像的 Azure 容器注册表Select the Azure Container Registry to which you pushed the Nginx image
  3. 选择“存储库” 可查看包含注册表中映像的存储库的列表Select Repositories to see a list of the repositories that contain the images in the registry
  4. 选择某个存储库以查看该存储库中的映像标记Select a repository to see the image tags within that repository

例如,如果已按照推送和拉取映像中的说明推送了 Nginx 映像,应看到的内容如下所示:For example, if you pushed the Nginx image as instructed in Push and pull an image, you should see something similar to:

门户中的存储库

后续步骤Next steps

现已基本了解如何在门户中查看和使用存储库,请尝试在 Azure Kubernetes 服务 (AKS) 群集中使用 Azure 容器注册表。Now that you know the basics of viewing and working with repositories in the portal, try using Azure Container Registry with an Azure Kubernetes Service (AKS) cluster.