Skip to content

Commit e665914

Browse files
authored
Merge pull request #107904 from dlepow/acrfix
[ACR] Import fixes
2 parents d397577 + b354a2b commit e665914

File tree

1 file changed

+44
-14
lines changed

1 file changed

+44
-14
lines changed

articles/container-registry/container-registry-import-images.md

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Import container images
33
description: Import container images to an Azure container registry by using Azure APIs, without needing to run Docker commands.
44
ms.topic: article
5-
ms.date: 02/06/2019
5+
ms.date: 03/16/2020
66
---
77

88
# Import container images to a container registry
@@ -19,14 +19,14 @@ Azure Container Registry handles a number of common scenarios to copy images fro
1919

2020
Image import into an Azure container registry has the following benefits over using Docker CLI commands:
2121

22-
* Because your client environment doesnt need a local Docker installation, import any container image, regardless of the supported OS type.
22+
* Because your client environment doesn't need a local Docker installation, import any container image, regardless of the supported OS type.
2323

2424
* When you import multi-architecture images (such as official Docker images), images for all architectures and platforms specified in the manifest list get copied.
2525

2626
To import container images, this article requires that you run the Azure CLI in Azure Cloud Shell or locally (version 2.0.55 or later recommended). Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][azure-cli].
2727

2828
> [!NOTE]
29-
> If you need to distribute identical container images across multiple Azure regions, Azure Container Registry also supports [geo-replication](container-registry-geo-replication.md). By geo-replicating a registry (Premium SKU required), you can serve multiple regions with identical image and tag names from a single registry.
29+
> If you need to distribute identical container images across multiple Azure regions, Azure Container Registry also supports [geo-replication](container-registry-geo-replication.md). By geo-replicating a registry (Premium service tier required), you can serve multiple regions with identical image and tag names from a single registry.
3030
>
3131
3232
## Prerequisites
@@ -42,27 +42,38 @@ To import an image to an Azure container registry, your identity must have write
4242
For example, use the [az acr import][az-acr-import] command to import the multi-architecture `hello-world:latest` image from Docker Hub to a registry named *myregistry*. Because `hello-world` is an official image from Docker Hub, this image is in the default `library` repository. Include the repository name and optionally a tag in the value of the `--source` image parameter. (You can optionally identify an image by its manifest digest instead of by tag, which guarantees a particular version of an image.)
4343

4444
```azurecli
45-
az acr import --name myregistry --source docker.io/library/hello-world:latest --image hello-world:latest
45+
az acr import \
46+
--name myregistry \
47+
--source docker.io/library/hello-world:latest \
48+
--image hello-world:latest
4649
```
4750

4851
You can verify that multiple manifests are associated with this image by running the `az acr repository show-manifests` command:
4952

5053
```azurecli
51-
az acr repository show-manifests --name myregistry --repository hello-world
54+
az acr repository show-manifests \
55+
--name myregistry \
56+
--repository hello-world
5257
```
5358

5459
The following example imports a public image from the `tensorflow` repository in Docker Hub:
5560

5661
```azurecli
57-
az acr import --name myregistry --source docker.io/tensorflow/tensorflow:latest-gpu --image tensorflow:latest-gpu
62+
az acr import \
63+
--name myregistry \
64+
--source docker.io/tensorflow/tensorflow:latest-gpu \
65+
--image tensorflow:latest-gpu
5866
```
5967

6068
### Import from Microsoft Container Registry
6169

6270
For example, import the latest Windows Server Core image from the `windows` repository in Microsoft Container Registry.
6371

6472
```azurecli
65-
az acr import --name myregistry --source mcr.microsoft.com/windows/servercore:latest --image servercore:latest
73+
az acr import \
74+
--name myregistry \
75+
--source mcr.microsoft.com/windows/servercore:latest \
76+
--image servercore:latest
6677
```
6778

6879
## Import from another Azure container registry
@@ -78,37 +89,56 @@ You can import an image from another Azure container registry using integrated A
7889
For example, import the `aci-helloworld:latest` image from a source registry *mysourceregistry* to *myregistry* in the same Azure subscription.
7990

8091
```azurecli
81-
az acr import --name myregistry --source mysourceregistry.azurecr.io/aci-helloworld:latest --image hello-world:latest
92+
az acr import \
93+
--name myregistry \
94+
--source mysourceregistry.azurecr.io/aci-helloworld:latest \
95+
--image aci-helloworld:latest
8296
```
8397

8498
The following example imports an image by manifest digest (SHA-256 hash, represented as `sha256:...`) instead of by tag:
8599

86100
```azurecli
87-
az acr import --name myregistry --source mysourceregistry.azurecr.io/aci-helloworld@sha256:123456abcdefg
101+
az acr import \
102+
--name myregistry \
103+
--source mysourceregistry.azurecr.io/aci-helloworld@sha256:123456abcdefg
88104
```
89105

90106
### Import from a registry in a different subscription
91107

92-
In the following example, *mysourceregistry* is in a different subscription from *myregistry* in the same Active Directory tenant. Supply the resource ID of the source registry with the `--registry` parameter. Notice that the `--source` parameter specifies only the source repository and image name, not the registry login server name.
93-
108+
In the following example, *mysourceregistry* is in a different subscription from *myregistry* in the same Active Directory tenant. Supply the resource ID of the source registry with the `--registry` parameter. Notice that the `--source` parameter specifies only the source repository and tag, not the registry login server name.
109+
94110
```azurecli
95-
az acr import --name myregistry --source sourcerepo/aci-helloworld:latest --image aci-hello-world:latest --registry /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/mysourceregistry
111+
az acr import \
112+
--name myregistry \
113+
--source samples/aci-helloworld:latest \
114+
--image aci-hello-world:latest \
115+
--registry /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/mysourceregistry
96116
```
97117

98118
### Import from a registry using service principal credentials
99119

100120
To import from a registry that you can't access using Active Directory permissions, you can use service principal credentials (if available). Supply the appID and password of an Active Directory [service principal](container-registry-auth-service-principal.md) that has ACRPull access to the source registry. Using a service principal is useful for build systems and other unattended systems that need to import images to your registry.
101121

102122
```azurecli
103-
az acr import --name myregistry --source sourceregistry.azurecr.io/sourcerepo/sourceimage:tag --image targetimage:tag --username <SP_App_ID> –-password <SP_Passwd>
123+
az acr import \
124+
--name myregistry \
125+
--source sourceregistry.azurecr.io/sourcerrepo:tag \
126+
--image targetimage:tag \
127+
--username <SP_App_ID> \
128+
–-password <SP_Passwd>
104129
```
105130

106131
## Import from a non-Azure private container registry
107132

108133
Import an image from a private registry by specifying credentials that enable pull access to the registry. For example, pull an image from a private Docker registry:
109134

110135
```azurecli
111-
az acr import --name myregistry --source docker.io/sourcerepo/sourceimage:tag --image sourceimage:tag --username <username> --password <password>
136+
az acr import \
137+
--name myregistry \
138+
--source docker.io/sourcerepo/sourceimage:tag \
139+
--image sourceimage:tag \
140+
--username <username> \
141+
--password <password>
112142
```
113143

114144
## Next steps

0 commit comments

Comments
 (0)