You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/container-registry/container-registry-tasks-overview.md
+44-17Lines changed: 44 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ manager: gwallace
7
7
8
8
ms.service: container-registry
9
9
ms.topic: article
10
-
ms.date: 06/12/2019
10
+
ms.date: 09/05/2019
11
11
ms.author: danlep
12
12
---
13
13
@@ -17,14 +17,22 @@ Containers provide new levels of virtualization, isolating application and devel
17
17
18
18
## What is ACR Tasks?
19
19
20
-
**ACR Tasks** is a suite of features within Azure Container Registry. It provides cloud-based container image building for Linux, Windows, and ARM, and can automate [OS and framework patching](#automate-os-and-framework-patching) for your Docker containers. ACR Tasks not only extends your "inner-loop" development cycle to the cloud with on-demand container image builds, but also enables automated builds on source code commit or when a container's base image is updated. With base image update triggers, you can automate your OS and application framework patching workflow, maintaining secure environments while adhering to the principals of immutable containers.
20
+
**ACR Tasks** is a suite of features within Azure Container Registry. It provides cloud-based container image building for [platforms](#image-platforms) including Linux, Windows, and ARM, and can automate [OS and framework patching](#automate-os-and-framework-patching) for your Docker containers. ACR Tasks not only extends your "inner-loop" development cycle to the cloud with on-demand container image builds, but also enables automated builds triggered by source code updates, updates to a container's base image, or timers. For example, with base image update triggers, you can automate your OS and application framework patching workflow, maintaining secure environments while adhering to the principles of immutable containers.
21
21
22
-
Build and test container images with ACR Tasks in four ways:
22
+
## Task scenarios
23
23
24
-
*[Quick task](#quick-task): Build and push container images on-demand, in Azure, without needing a local Docker Engine installation. Think `docker build`, `docker push` in the cloud. Build from local source code or a Git repository.
25
-
*[Build on source code commit](#automatic-build-on-source-code-commit): Trigger a container image build automatically when code is committed to a Git repository.
26
-
*[Build on base image update](#automate-os-and-framework-patching): Trigger a container image build when that image's base image has been updated.
27
-
*[Multi-step tasks](#multi-step-tasks): Define multi-step tasks that build images, run containers as commands, and push images to a registry. This feature of ACR Tasks supports on-demand task execution and parallel image build, test, and push operations.
24
+
ACR Tasks supports several scenarios to build and maintain container images and other artifacts. See the following sections in this article for details.
25
+
26
+
***[Quick task](#quick-task)** - Build and push a single container image to a container registry on-demand, in Azure, without needing a local Docker Engine installation. Think `docker build`, `docker push` in the cloud.
27
+
***Automatically triggered tasks** - Enable one or more *triggers* to build an image:
28
+
***[Trigger on source code update](#trigger-task-on-source-code-update)**
29
+
***[Trigger on base image update](#automate-os-and-framework-patching)**
30
+
***[Trigger on a schedule](#schedule-a-task)**
31
+
***[Multi-step task](#multi-step-tasks)** - Extend the single image build-and-push capability of ACR Tasks with multi-step, multi-container-based workflows.
32
+
33
+
Each ACR Task has an associated [source code context](#context-locations) - the location of a set of source files used to build a container image or other artifact. Example contexts include a Git repository or a local filesystem.
34
+
35
+
Tasks can also take advantage of [run variables](container-registry-tasks-reference-yaml.md#run-variables), so you can reuse task definitions and standardize tags for images and artifacts.
28
36
29
37
## Quick task
30
38
@@ -40,12 +48,21 @@ ACR Tasks is designed as a container lifecycle primitive. For example, integrate
40
48
41
49
Learn how to use quick tasks in the first ACR Tasks tutorial, [Build container images in the cloud with Azure Container Registry Tasks](container-registry-tutorial-quick-task.md).
42
50
43
-
## Automatic build on source code commit
51
+
> [!TIP]
52
+
> If you want to build and push an image directly from source code, without a Dockerfile, Azure Container Registry provides the [az acr pack build][az-acr-pack-build] command (preview). This tool builds and pushes an image from application source code using [Cloud Native Buildpacks](https://buildpacks.io/).
53
+
54
+
## Trigger task on source code update
55
+
56
+
Trigger a container image build or multi-step task when code is committed, or a pull request is made or updated, to a Git repository in GitHub or Azure DevOps. For example, configure a build task with the Azure CLI command [az acr task create][az-acr-task-create] by specifying a Git repository and optionally a branch and Dockerfile. When your team updates code in the repository, an ACR Tasks-created webhook triggers a build of the container image defined in the repo.
44
57
45
-
Use ACR Tasks to automatically trigger a container image build when code is committed to a Git repository in GitHub or Azure DevOps. Build tasks, configurable with the Azure CLI command [az acr task][az-acr-task], allow you to specify a Git repository and optionally a branch and Dockerfile. When your team commits code to the repository, an ACR Tasks-created webhook triggers a build of the container image defined in the repo.
58
+
ACR Tasks supports the following triggers when you set a Git repo as the task's context:
46
59
47
-
> [!IMPORTANT]
48
-
> If you previously created tasks during the preview with the `az acr build-task` command, those tasks need to be re-created using the [az acr task][az-acr-task] command.
60
+
| Trigger | Enabled by default |
61
+
| ------- | ------------------ |
62
+
| Commit | Yes |
63
+
| Pull request | No |
64
+
65
+
To configure the trigger, you provide the task a personal access token (PAT) to set the webhook in the GitHub or Azure DevOps repo.
49
66
50
67
Learn how to trigger builds on source code commit in the second ACR Tasks tutorial, [Automate container image builds with Azure Container Registry Tasks](container-registry-tutorial-build-task.md).
51
68
@@ -59,25 +76,33 @@ When an OS or app framework image is updated by the upstream maintainer, for exa
59
76
60
77
Because ACR Tasks dynamically discovers base image dependencies when it builds a container image, it can detect when an application image's base image is updated. With one preconfigured [build task](container-registry-tutorial-base-image-update.md#create-a-task), ACR Tasks then **automatically rebuilds every application image** for you. With this automatic detection and rebuilding, ACR Tasks saves you the time and effort normally required to manually track and update each and every application image referencing your updated base image.
61
78
62
-
An ACR task tracks a base image update when the base image is in one of the following locations:
79
+
For image builds from a Dockerfile, an ACR task tracks a base image update when the base image is in one of the following locations:
63
80
64
81
* The same Azure container registry where the task runs
65
82
* Another Azure container registry in the same region
66
83
* A public repo in Docker Hub
67
84
* A public repo in Microsoft Container Registry
68
85
86
+
> [!NOTE]
87
+
> * The base image update trigger is enabled by default in an ACR task.
88
+
> * Currently, ACR Tasks only tracks base image updates for application (*runtime*) images. ACR Tasks doesn't track base image updates for intermediate (*buildtime*) images used in multi-stage Dockerfiles.
89
+
69
90
Learn more about OS and framework patching in the third ACR Tasks tutorial, [Automate image builds on base image update with Azure Container Registry Tasks](container-registry-tutorial-base-image-update.md).
70
91
92
+
## Schedule a task
93
+
94
+
Optionally schedule a task by setting up one or more *timer triggers* when you create or update the task. Scheduling a task is useful for running container workloads on a defined schedule, or running maintenance operations or tests on images pushed regularly to your registry. For details, see [Run an ACR task on a defined schedule](container-registry-tasks-scheduled.md).
95
+
71
96
## Multi-step tasks
72
97
73
-
Multi-step tasks provide step-based task definition and execution for building, testing, and patching container images in the cloud. Task steps define individual container image build and push operations. They can also define the execution of one or more containers, with each step using the container as its execution environment.
98
+
Multi-step tasks provide step-based task definition and execution for building, testing, and patching container images in the cloud. Task steps defined in a [YAML file](container-registry-tasks-reference-yaml.md) specify individual build and push operations for container images or other artifacts. They can also define the execution of one or more containers, with each step using the container as its execution environment.
74
99
75
100
For example, you can create a multi-step task that automates the following:
76
101
77
102
1. Build a web application image
78
103
1. Run the web application container
79
104
1. Build a web application test image
80
-
1. Run the web application test container which performs tests against the running application container
105
+
1. Run the web application test container, which performs tests against the running application container
81
106
1. If the tests pass, build a Helm chart archive package
82
107
1. Perform a `helm upgrade` using the new Helm chart archive package
83
108
@@ -110,15 +135,15 @@ By default, ACR Tasks builds images for the Linux OS and the amd64 architecture.
110
135
111
136
Each task run generates log output that you can inspect to determine whether the task steps ran successfully. If you use the [az acr build](/cli/azure/acr#az-acr-build), [az acr run](/cli/azure/acr#az-acr-run), or [az acr task run](/cli/azure/acr/task#az-acr-task-run) command to trigger the task, log output for the task run is streamed to the console and also stored for later retrieval. When a task is automatically triggered, for example by a source code commit or a base image update, task logs are only stored. View the logs for a task run in the Azure portal, or use the [az acr task logs](/cli/azure/acr/task#az-acr-task-logs) command.
112
137
113
-
Starting in July 2019, data and logs for task runs in a registry will be retained by default for 30 days and then automatically purged. If you want to archive the data for a task run, enable archiving using the [az acr task update-run](/cli/azure/acr/task#az-acr-task-update-run) command. The following example enables archiving for the task run *cf11* in registry *myregistry*.
138
+
By default, data and logs for task runs in a registry are retained for 30 days and then automatically purged. If you want to archive the data for a task run, enable archiving using the [az acr task update-run](/cli/azure/acr/task#az-acr-task-update-run) command. The following example enables archiving for the task run *cf11* in registry *myregistry*.
114
139
115
140
```azurecli
116
141
az acr task update-run --registry myregistry --run-id cf11 --no-archive false
117
142
```
118
143
119
144
## Next steps
120
145
121
-
When you're ready to automate OS and framework patching by building your container images in the cloud, check out the three-part[ACR Tasks tutorial series](container-registry-tutorial-quick-task.md).
146
+
When you're ready to automate container image builds and maintenance in the cloud, check out the [ACR Tasks tutorial series](container-registry-tutorial-quick-task.md).
122
147
123
148
Optionally install the [Docker Extension for Visual Studio Code](https://code.visualstudio.com/docs/azure/docker) and the [Azure Account](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account) extension to work with your Azure container registries. Pull and push images to an Azure container registry, or run ACR Tasks, all within Visual Studio Code.
124
149
@@ -133,7 +158,9 @@ Optionally install the [Docker Extension for Visual Studio Code](https://code.vi
0 commit comments