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
For increased readability, use nested syntax when pushing multiple images:
@@ -206,8 +206,8 @@ version: v1.1.0
206
206
steps:
207
207
# Nested YAML collection syntax
208
208
- push:
209
-
- {{.Run.Registry}}/hello-world:{{.Run.ID}}
210
-
- {{.Run.Registry}}/hello-world:latest
209
+
- $Registry/hello-world:$ID
210
+
- $Registry/hello-world:latest
211
211
```
212
212
213
213
### Properties: push
@@ -333,26 +333,24 @@ steps:
333
333
334
334
By using the standard `docker run` image reference convention, `cmd` can run images from any private registry or the public Docker Hub. If you're referencing images in the same registry in which ACR Task is executing, you don't need to specify any registry credentials.
335
335
336
-
* Run an image that's from an Azure container registry
337
-
338
-
Replace `[myregistry]` with the name of your registry:
336
+
* Run an image that's from an Azure container registry. The following example assumes you have a registry named `myregistry`, and a custom image `myimage:mytag`.
339
337
340
338
```yml
341
339
version: v1.1.0
342
340
steps:
343
-
- cmd: [myregistry].azurecr.io/bash:3.0 echo hello world
341
+
- cmd: myregistry.azurecr.io/myimage:mytag
344
342
```
345
343
346
-
* Generalize the registry reference with a Run variable
344
+
* Generalize the registry reference with a Run variable or alias
347
345
348
-
Instead of hard-coding your registry name in an `acr-task.yaml` file, you can make it more portable by using a [Run variable](#run-variables). The `Run.Registry` variable expands at runtime to the name of the registry in which the task is executing.
346
+
Instead of hard-coding your registry name in an `acr-task.yaml` file, you can make it more portable by using a [Run variable](#run-variables) or [alias](#aliases). The `Run.Registry` variable or `$Registry` alias expands at runtime to the name of the registry in which the task is executing.
349
347
350
-
To generalize the preceding task so that it works in any Azure container registry, reference the [Run.Registry](#runregistry) variable in the image name:
348
+
For example, to generalize the preceding task so that it works in any Azure container registry, reference the $Registry variable in the image name:
351
349
352
350
```yml
353
351
version: v1.1.0
354
352
steps:
355
-
- cmd: {{.Run.Registry}}/bash:3.0 echo hello world
353
+
- cmd: $Registry/myimage:mytag
356
354
```
357
355
358
356
## Task step properties
@@ -455,19 +453,20 @@ ACR Tasks includes a default set of variables that are available to task steps w
455
453
* `Run.Architecture`
456
454
* `Run.Commit`
457
455
* `Run.Branch`
456
+
* `Run.TaskName`
458
457
459
-
The variable names are generally self-explanatory. Details follows for commonly used variables.
458
+
The variable names are generally self-explanatory. Details follows for commonly used variables. As of YAML version `v1.1.0`, you can use an abbreviated, predefined [task alias](#aliases) in place of most run variables. For example, in place of `{{.Run.Registry}}`, use the `$Registry` alias.
460
459
461
460
### Run.ID
462
461
463
-
Each Run, through `az acr run`, or trigger based execution of tasks created through `az acr task create` have a unique ID. The ID represents the Run currently being executed.
462
+
Each Run, through `az acr run`, or trigger based execution of tasks created through `az acr task create`, has a unique ID. The ID represents the Run currently being executed.
0 commit comments