Skip to content

Commit d9492a0

Browse files
authored
Merge pull request #103035 from dlepow/acrfix
[ACR] Freshness for task quickstart
2 parents 2412e2f + b39dd6b commit d9492a0

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

articles/container-registry/container-registry-quickstart-task-cli.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
title: Quickstart - Build & run container image
3-
description: Quickly run tasks with Azure Container Registry to build and run a container image on-demand, in the cloud.
3+
description: Quickly run tasks with Azure Container Registry to build and run a Docker container image on-demand, in the cloud.
44
ms.topic: quickstart
5-
ms.date: 04/02/2019
5+
ms.date: 01/31/2020
66
---
7+
78
# Quickstart: Build and run a container image using Azure Container Registry Tasks
89

910
In this quickstart, you use Azure Container Registry Tasks commands to quickly build, push, and run a Docker container image natively within Azure, showing how to offload your "inner-loop" development cycle to the cloud. [ACR Tasks][container-registry-tasks-overview] is a suite of features within Azure Container Registry to help you manage and modify container images across the container lifecycle.
@@ -34,11 +35,11 @@ Create a container registry using the [az acr create][az-acr-create] command. Th
3435
az acr create --resource-group myResourceGroup --name myContainerRegistry008 --sku Basic
3536
```
3637

37-
This example creates a *Basic* registry, a cost-optimized option for developers learning about Azure Container Registry. For details on available service tiers, see [Container registry SKUs][container-registry-skus].
38+
This example creates a *Basic* registry, a cost-optimized option for developers learning about Azure Container Registry. For details on available service tiers, see [Container registry SKUs][container-registry-skus].
3839

3940
## Build an image from a Dockerfile
4041

41-
Now use Azure Container Registry to build an image. First, create a working directory and then create a Dockerfile named *Dockerfile* with the following content. This is a simple example to build a Linux container image, but you can create your own standard Dockerfile and build images for other platforms.
42+
Now use Azure Container Registry to build an image. First, create a working directory and then create a Dockerfile named *Dockerfile* with the following content. This is a simple example to build a Linux container image, but you can create your own standard Dockerfile and build images for other platforms. Command examples in this article are formatted for the bash shell.
4243

4344
```bash
4445
echo FROM hello-world > Dockerfile
@@ -47,7 +48,9 @@ echo FROM hello-world > Dockerfile
4748
Run the [az acr build][az-acr-build] command to build the image. When successfully built, the image is pushed to your registry. The following example pushes the `sample/hello-world:v1` image. The `.` at the end of the command sets the location of the Dockerfile, in this case the current directory.
4849

4950
```azurecli-interactive
50-
az acr build --image sample/hello-world:v1 --registry myContainerRegistry008 --file Dockerfile .
51+
az acr build --image sample/hello-world:v1 \
52+
--registry myContainerRegistry008 \
53+
--file Dockerfile .
5154
```
5255

5356
Output from a successful build and push is similar to the following:
@@ -104,23 +107,17 @@ Run ID: ca8 was successful after 10s
104107

105108
## Run the image
106109

107-
Now quickly run the image you built and pushed to your registry. In your container development workflow, this might be a validation step before you deploy the image.
108-
109-
Create a file *quickrun.yaml* in a local working directory with the following content for a single step. Substitute the login server name of your registry for *\<acrLoginServer\>*. The login server name is in the format *\<registry-name\>.azurecr.io* (all lowercase), for example, *mycontainerregistry008.azurecr.io*. This example assumes that you built and pushed the `sample/hello-world:v1` image in the previous section:
110-
111-
```yml
112-
steps:
113-
- cmd: <acrLoginServer>/sample/hello-world:v1
114-
```
115-
116-
The `cmd` step in this example runs the container in its default configuration, but `cmd` supports additional `docker run` parameters or even other `docker` commands.
110+
Now quickly run the image you built and pushed to your registry. Here you use [az acr run][az-acr-run] to run the container command. In your container development workflow, this might be a validation step before you deploy the image, or you could include the command in a [multi-step YAML file][container-registry-tasks-multi-step].
117111

118-
Run the container with the following command:
112+
The following example uses `$Registry` to specify the registry where you run the command:
119113

120114
```azurecli-interactive
121-
az acr run --registry myContainerRegistry008 --file quickrun.yaml .
115+
az acr run --registry myContainerRegistry008 \
116+
--cmd '$Registry/sample/hello-world:v1' /dev/null
122117
```
123118

119+
The `cmd` parameter in this example runs the container in its default configuration, but `cmd` supports additional `docker run` parameters or even other `docker` commands.
120+
124121
Output is similar to the following:
125122

126123
```console
@@ -176,10 +173,10 @@ az group delete --name myResourceGroup
176173

177174
## Next steps
178175

179-
In this quickstart, you used features of ACR Tasks to quickly build, push, and run a Docker container image natively within Azure. Continue to the Azure Container Registry tutorials to learn about using ACR Tasks to automate image builds and updates.
176+
In this quickstart, you used features of ACR Tasks to quickly build, push, and run a Docker container image natively within Azure, without a local Docker installation. Continue to the Azure Container Registry Tasks tutorials to learn about using ACR Tasks to automate image builds and updates.
180177

181178
> [!div class="nextstepaction"]
182-
> [Azure Container Registry tutorials][container-registry-tutorial-quick-task]
179+
> [Azure Container Registry Tasks tutorials][container-registry-tutorial-quick-task]
183180
184181
<!-- LINKS - external -->
185182
[docker-linux]: https://docs.docker.com/engine/installation/#supported-platforms
@@ -195,10 +192,12 @@ In this quickstart, you used features of ACR Tasks to quickly build, push, and r
195192
<!-- LINKS - internal -->
196193
[az-acr-create]: /cli/azure/acr#az-acr-create
197194
[az-acr-build]: /cli/azure/acr#az-acr-build
195+
[az-acr-run]: /cli/azure/acr#az-acr-run
198196
[az-group-create]: /cli/azure/group#az-group-create
199197
[az-group-delete]: /cli/azure/group#az-group-delete
200198
[azure-cli]: /cli/azure/install-azure-cli
201199
[container-registry-tasks-overview]: container-registry-tasks-overview.md
200+
[container-registry-tasks-multi-step]: container-registry-tasks-multi-step.md
202201
[container-registry-tutorial-quick-task]: container-registry-tutorial-quick-task.md
203202
[container-registry-skus]: container-registry-skus.md
204203
[azure-cli-install]: /cli/azure/install-azure-cli

0 commit comments

Comments
 (0)