Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7a10ba0

Browse files
committedNov 28, 2017
[acr] push & pull image udpate
1 parent ae2fddc commit 7a10ba0

File tree

2 files changed

+30
-40
lines changed

2 files changed

+30
-40
lines changed
 
Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,89 @@
11
---
2-
title: Push Docker image to private Azure registry | Microsoft Docs
2+
title: Push Docker image to private Azure registry
33
description: Push and pull Docker images to a private container registry in Azure using the Docker CLI
44
services: container-registry
5-
documentationcenter: ''
65
author: stevelas
76
manager: balans
8-
editor: cristyg
9-
tags: ''
10-
keywords: ''
7+
editor: mmacy
118

12-
ms.assetid: 64fbe43f-fdde-4c17-a39a-d04f2d6d90a1
139
ms.service: container-registry
14-
ms.devlang: na
1510
ms.topic: article
16-
ms.tgt_pltfrm: na
17-
ms.workload: na
18-
ms.date: 03/24/2017
11+
ms.date: 12/01/2017
1912
ms.author: stevelas
2013
ms.custom: H1Hack27Feb2017
2114
---
22-
# Push your first image to a private Docker container registry using the Docker CLI
23-
An Azure container registry stores and manages private [Docker](http://hub.docker.com) container images, similar to the way [Docker Hub](https://hub.docker.com/) stores public Docker images. You use the [Docker Command-Line Interface](https://docs.docker.com/engine/reference/commandline/cli/) (Docker CLI) for [login](https://docs.docker.com/engine/reference/commandline/login/), [push](https://docs.docker.com/engine/reference/commandline/push/), [pull](https://docs.docker.com/engine/reference/commandline/pull/), and other operations on your container registry.
2415

25-
For more background and concepts, see [the overview](container-registry-intro.md)
16+
# Push your first image to a private Docker container registry using the Docker CLI
2617

18+
An Azure container registry stores and manages private [Docker](http://hub.docker.com) container images, similar to the way [Docker Hub](https://hub.docker.com/) stores public Docker images. You use the [Docker command-line interface](https://docs.docker.com/engine/reference/commandline/cli/) (Docker CLI) for [login](https://docs.docker.com/engine/reference/commandline/login/), [push](https://docs.docker.com/engine/reference/commandline/push/), [pull](https://docs.docker.com/engine/reference/commandline/pull/), and other operations on your container registry.
2719

20+
In the following steps, you download an official NGINX image from the public Docker Hub registry, tag it for your private Azure container registry, push it to your registry, and then pull it from the registry.
2821

2922
## Prerequisites
23+
3024
* **Azure container registry** - Create a container registry in your Azure subscription. For example, use the [Azure portal](container-registry-get-started-portal.md) or the [Azure CLI 2.0](container-registry-get-started-azure-cli.md).
3125
* **Docker CLI** - To set up your local computer as a Docker host and access the Docker CLI commands, install [Docker Engine](https://docs.docker.com/engine/installation/).
3226

3327
## Log in to a registry
34-
Run `docker login` to log in to your container registry with your [registry credentials](container-registry-authentication.md).
3528

36-
The following example passes the ID and password of an Azure Active Directory [service principal](../active-directory/active-directory-application-objects.md). For example, you might have assigned a service principal to your registry for an automation scenario.
29+
There are [several ways to authenticate](container-registry-authentication.md) to your private container registry. The recommended method when working in a command line is with the Azure CLI command [az acr login](/cli/azure/acr?view=azure-cli-latest#az_acr_login):
30+
31+
```azurecli
32+
az acr login --name <acrName>
33+
```
34+
35+
You can also log in with `docker login`. The following example passes the ID and password of an Azure Active Directory [service principal](../active-directory/active-directory-application-objects.md). For example, you might have [assigned a service principal](container-registry-authentication.md#service-principal) to your registry for an automation scenario.
3736

3837
```
3938
docker login myregistry.azurecr.io -u xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -p myPassword
4039
```
4140

42-
> [!TIP]
43-
> Make sure to specify the fully qualified registry name (all lowercase). In this example, it is `myregistry.azurecr.io`.
41+
Both commands returns `Login Succeeded` once completed. If you use `docker login`, 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](https://docs.docker.com/engine/reference/commandline/login/) command reference for more information.
4442

45-
## Steps to pull and push an image
46-
The follow example downloads the Nginx image from the public Docker Hub registry, tags it for your private Azure container registry, pushes it to your registry, then pulls it again.
43+
> [!TIP]
44+
> Make sure to specify the fully qualified registry name (all lowercase) when you use `docker login` and when you tag your images. In this example, the fully qualified name is *myregistry.azurecr.io*.
4745
48-
**1. Pull the Docker official image for Nginx**
46+
## Pull the official NGINX Docker image
4947

50-
First pull the public Nginx image to your local computer.
48+
First, pull the public NGINX image to your local computer.
5149

5250
```
5351
docker pull nginx
5452
```
55-
**2. Start the Nginx container**
5653

57-
The following command starts the local Nginx container interactively on port 8080, allowing you to see output from Nginx. It removes the running container once stopped.
54+
You can optionally execute following command to start a local instance of the NGINX container on port 8080, allowing you to see output from NGINX. It removes the running container once stopped.
5855

5956
```
6057
docker run -it --rm -p 8080:80 nginx
6158
```
6259

63-
Browse to [http://localhost:8080](http://localhost:8080) to view the running container. You see a screen similar to the following one.
60+
Browse to [http://localhost:8080](http://localhost:8080) to view the running container. You see a screen similar to the following:
6461

6562
![Nginx on local computer](./media/container-registry-get-started-docker-cli/nginx.png)
6663

67-
To stop the running container, press [CTRL]+[C].
64+
To stop the container, press `Control+C`.
6865

69-
**3. Create an alias of the image in your registry**
66+
## Create an alias of the image for your registry
7067

7168
The following command creates an alias of the image, with a fully qualified path to your registry. This example specifies the `samples` namespace to avoid clutter in the root of the registry.
7269

7370
```
7471
docker tag nginx myregistry.azurecr.io/samples/nginx
75-
```
72+
```
7673

77-
**4. Push the image to your registry**
74+
## Push the image to your registry
7875

7976
```
8077
docker push myregistry.azurecr.io/samples/nginx
8178
```
8279

83-
**5. Pull the image from your registry**
80+
## Pull the image from your registry
8481

8582
```
8683
docker pull myregistry.azurecr.io/samples/nginx
8784
```
8885

89-
**6. Start the Nginx container from your registry**
86+
## Start the NGINX container from your registry
9087

9188
```
9289
docker run -it --rm -p 8080:80 myregistry.azurecr.io/samples/nginx
@@ -96,19 +93,12 @@ Browse to [http://localhost:8080](http://localhost:8080) to view the running con
9693

9794
To stop the running container, press [CTRL]+[C].
9895

99-
**7. (Optional) Remove the image**
96+
## Remove the image (optional)
10097

10198
```
10299
docker rmi myregistry.azurecr.io/samples/nginx
103100
```
104101

105-
##Concurrent Limits
106-
In some scenarios, executing calls concurrently might result in errors. The following table contains the limits of concurrent calls with "Push" and "Pull" operations on Azure container registry:
107-
108-
| Operation | Limit |
109-
| ---------- | -------------------------------------- |
110-
| PULL | Up to 10 concurrent pulls per registry |
111-
| PUSH | Up to 5 concurrent pushes per registry |
112-
113102
## Next steps
114-
Now that you know the basics, you are ready to start using your registry! For example, start deploying container images to an [Azure Container Service](https://azure.microsoft.com/documentation/services/container-service/) cluster.
103+
104+
Now that you know the basics, you're ready to start using your registry! For example, deploy container images from your registry to an [Azure Container Service (AKS)](../aks/tutorial-kubernetes-prepare-app.md) cluster.
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.