Skip to content

Commit 6af8a1e

Browse files
authored
Merge pull request #106103 from v-thepet/azurecli2
Fix azurecli tags in container-registry folder
2 parents 03cf33e + 1a1e723 commit 6af8a1e

13 files changed

+112
-129
lines changed

articles/container-registry/container-registry-best-practices.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ By leveraging repository namespaces, you can allow sharing a single registry acr
3030

3131
For example, consider the following container image tags. Images that are used corporate-wide, like `aspnetcore`, are placed in the root namespace, while container images owned by the Products and Marketing groups each use their own namespaces.
3232

33-
```
34-
contoso.azurecr.io/aspnetcore:2.0
35-
contoso.azurecr.io/products/widget/web:1
36-
contoso.azurecr.io/products/bettermousetrap/refundapi:12.3
37-
contoso.azurecr.io/marketing/2017-fall/concertpromotions/campaign:218.42
38-
```
33+
- *contoso.azurecr.io/aspnetcore:2.0*
34+
- *contoso.azurecr.io/products/widget/web:1*
35+
- *contoso.azurecr.io/products/bettermousetrap/refundapi:12.3*
36+
- *contoso.azurecr.io/marketing/2017-fall/concertpromotions/campaign:218.42*
3937

4038
## Dedicated resource group
4139

@@ -60,8 +58,11 @@ The storage constraints of each [container registry SKU][container-registry-skus
6058

6159
Use the Azure CLI command [az acr show-usage][az-acr-show-usage] to display the current size of your registry:
6260

63-
```console
64-
$ az acr show-usage --resource-group myResourceGroup --name myregistry --output table
61+
```azurecli
62+
az acr show-usage --resource-group myResourceGroup --name myregistry --output table
63+
```
64+
65+
```output
6566
NAME LIMIT CURRENT VALUE UNIT
6667
-------- ------------ --------------- ------
6768
Size 536870912000 185444288 Bytes

articles/container-registry/container-registry-concepts.md

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ In addition to Docker container images, Azure Container Registry supports relate
1919

2020
The address of an artifact in an Azure container registry includes the following elements.
2121

22-
```
23-
[loginUrl]/[namespace]/[artifact:][tag]
24-
```
22+
`[loginUrl]/[namespace]/[artifact:][tag]`
2523

2624
* **loginUrl** - The fully qualified name of the registry host. The registry host in an Azure container registry is in the format *myregistry*.azurecr.io (all lowercase). You must specify the loginUrl when using Docker or other client tools to pull or push artifacts to an Azure container registry.
2725
* **namespace** - Slash-delimited logical grouping of related images or artifacts - for example, for a workgroup or app
@@ -31,31 +29,26 @@ The address of an artifact in an Azure container registry includes the following
3129

3230
For example, the full name of an image in an Azure container registry might look like:
3331

34-
```
35-
myregistry.azurecr.io/marketing/campaign10-18/email-sender:v2
36-
```
32+
*myregistry.azurecr.io/marketing/campaign10-18/email-sender:v2*
3733

3834
See the following sections for details about these elements.
3935

4036
## Repository name
4137

4238
Container registries manage *repositories*, collections of container images or other artifacts with the same name, but different tags. For example, the following three images are in the "acr-helloworld" repository:
4339

44-
```
45-
acr-helloworld:latest
46-
acr-helloworld:v1
47-
acr-helloworld:v2
48-
```
40+
41+
- *acr-helloworld:latest*
42+
- *acr-helloworld:v1*
43+
- *acr-helloworld:v2*
4944

5045
Repository names can also include [namespaces](container-registry-best-practices.md#repository-namespaces). Namespaces allow you to group images using forward slash-delimited repository names, for example:
5146

52-
```
53-
marketing/campaign10-18/web:v2
54-
marketing/campaign10-18/api:v3
55-
marketing/campaign10-18/email-sender:v2
56-
product-returns/web-submission:20180604
57-
product-returns/legacy-integrator:20180715
58-
```
47+
- *marketing/campaign10-18/web:v2*
48+
- *marketing/campaign10-18/api:v3*
49+
- *marketing/campaign10-18/email-sender:v2*
50+
- *product-returns/web-submission:20180604*
51+
- *product-returns/legacy-integrator:20180715*
5952

6053
## Image
6154

@@ -87,8 +80,11 @@ az acr repository show-manifests --name <acrName> --repository <repositoryName>
8780

8881
For example, list the manifests for the "acr-helloworld" repository:
8982

90-
```console
91-
$ az acr repository show-manifests --name myregistry --repository acr-helloworld
83+
```azurecli
84+
az acr repository show-manifests --name myregistry --repository acr-helloworld
85+
```
86+
87+
```output
9288
[
9389
{
9490
"digest": "sha256:0a2e01852872580b2c2fea9380ff8d7b637d3928783c55beb3f21a6e58d5d108",
@@ -123,9 +119,7 @@ You can pull an image from a registry by specifying its digest in the pull opera
123119

124120
For example, pull an image from the "acr-helloworld" repository by manifest digest:
125121

126-
```console
127-
$ docker pull myregistry.azurecr.io/acr-helloworld@sha256:0a2e01852872580b2c2fea9380ff8d7b637d3928783c55beb3f21a6e58d5d108
128-
```
122+
`docker pull myregistry.azurecr.io/acr-helloworld@sha256:0a2e01852872580b2c2fea9380ff8d7b637d3928783c55beb3f21a6e58d5d108`
129123

130124
> [!IMPORTANT]
131125
> If you repeatedly push modified images with identical tags, you might create orphaned images--images that are untagged, but still consume space in your registry. Untagged images are not shown in the Azure CLI or in the Azure portal when you list or view images by tag. However, their layers still exist and consume space in your registry. Deleting an untagged image frees registry space when the manifest is the only one, or the last one, pointing to a particular layer. For information about freeing space used by untagged images, see [Delete container images in Azure Container Registry](container-registry-delete.md).

articles/container-registry/container-registry-delete.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ To delete by tag, use [az acr repository delete][az-acr-repository-delete] and s
3838
For example, deleting the "acr-helloworld:latest" image from registry "myregistry":
3939

4040
```azurecli
41-
$ az acr repository delete --name myregistry --image acr-helloworld:latest
41+
az acr repository delete --name myregistry --image acr-helloworld:latest
42+
```
43+
44+
```output
4245
This operation will delete the manifest 'sha256:0a2e01852872580b2c2fea9380ff8d7b637d3928783c55beb3f21a6e58d5d108' and all the following images: 'acr-helloworld:latest', 'acr-helloworld:v3'.
43-
Are you sure you want to continue? (y/n): y
46+
Are you sure you want to continue? (y/n):
4447
```
4548

4649
> [!TIP]
@@ -52,8 +55,11 @@ A [manifest digest](container-registry-concepts.md#manifest-digest) can be assoc
5255

5356
To delete by digest, first list the manifest digests for the repository containing the images you wish to delete. For example:
5457

55-
```console
56-
$ az acr repository show-manifests --name myregistry --repository acr-helloworld
58+
```azurecli
59+
az acr repository show-manifests --name myregistry --repository acr-helloworld
60+
```
61+
62+
```output
5763
[
5864
{
5965
"digest": "sha256:0a2e01852872580b2c2fea9380ff8d7b637d3928783c55beb3f21a6e58d5d108",
@@ -81,10 +87,13 @@ az acr repository delete --name <acrName> --image <repositoryName>@<digest>
8187

8288
For example, to delete the last manifest listed in the preceding output (with the tag "v2"):
8389

84-
```console
85-
$ az acr repository delete --name myregistry --image acr-helloworld@sha256:3168a21b98836dda7eb7a846b3d735286e09a32b0aa2401773da518e7eba3b57
90+
```azurecli
91+
az acr repository delete --name myregistry --image acr-helloworld@sha256:3168a21b98836dda7eb7a846b3d735286e09a32b0aa2401773da518e7eba3b57
92+
```
93+
94+
```output
8695
This operation will delete the manifest 'sha256:3168a21b98836dda7eb7a846b3d735286e09a32b0aa2401773da518e7eba3b57' and all the following images: 'acr-helloworld:v2'.
87-
Are you sure you want to continue? (y/n): y
96+
Are you sure you want to continue? (y/n):
8897
```
8998

9099
The `acr-helloworld:v2` image is deleted from the registry, as is any layer data unique to that image. If a manifest is associated with multiple tags, all associated tags are also deleted.
@@ -143,8 +152,12 @@ As mentioned in the [Manifest digest](container-registry-concepts.md#manifest-di
143152
1. Push image *acr-helloworld* with tag **latest**: `docker push myregistry.azurecr.io/acr-helloworld:latest`
144153
1. Check manifests for repository *acr-helloworld*:
145154

146-
```console
147-
$ az acr repository show-manifests --name myregistry --repository acr-helloworld
155+
```azurecli
156+
az acr repository show-manifests --name myregistry --repository acr-helloworld
157+
158+
```
159+
160+
```output
148161
[
149162
{
150163
"digest": "sha256:d2bdc0c22d78cde155f53b4092111d7e13fe28ebf87a945f94b19c248000ceec",
@@ -160,8 +173,11 @@ As mentioned in the [Manifest digest](container-registry-concepts.md#manifest-di
160173
1. Push image *acr-helloworld* with tag **latest**: `docker push myregistry.azurecr.io/acr-helloworld:latest`
161174
1. Check manifests for repository *acr-helloworld*:
162175

163-
```console
164-
$ az acr repository show-manifests --name myregistry --repository acr-helloworld
176+
```azurecli
177+
az acr repository show-manifests --name myregistry --repository acr-helloworld
178+
```
179+
180+
```output
165181
[
166182
{
167183
"digest": "sha256:7ca0e0ae50c95155dbb0e380f37d7471e98d2232ed9e31eece9f9fb9078f2728",

articles/container-registry/container-registry-event-grid-quickstart.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ az eventgrid event-subscription create \
108108

109109
When the subscription is completed, you should see output similar to the following:
110110

111-
```JSON
111+
```json
112112
{
113113
"destination": {
114114
"endpointBaseUrl": "https://eventgridviewer.azurewebsites.net/api/updates",
@@ -147,8 +147,7 @@ az acr build --registry $ACR_NAME --image myimage:v1 -f Dockerfile https://githu
147147

148148
You should see output similar to the following while ACR Tasks builds and then pushes your image. The following sample output has been truncated for brevity.
149149

150-
```console
151-
$ az acr build -r $ACR_NAME --image myimage:v1 -f Dockerfile https://github.com/Azure-Samples/acr-build-helloworld-node.git
150+
```output
152151
Sending build context to ACR...
153152
Queued a build with build ID: aa2
154153
Waiting for build agent...
@@ -170,8 +169,7 @@ az acr repository show-tags --name $ACR_NAME --repository myimage
170169

171170
The "v1" tag of the image you built should appear in the output, similar to the following:
172171

173-
```console
174-
$ az acr repository show-tags --name $ACR_NAME --repository myimage
172+
```output
175173
[
176174
"v1"
177175
]
@@ -187,10 +185,9 @@ az acr repository delete --name $ACR_NAME --image myimage:v1
187185

188186
You should see output similar to the following, asking for confirmation to delete the manifest and associated images:
189187

190-
```console
191-
$ az acr repository delete --name $ACR_NAME --image myimage:v1
188+
```output
192189
This operation will delete the manifest 'sha256:f15fa9d0a69081ba93eee308b0e475a54fac9c682196721e294b2bc20ab23a1b' and all the following images: 'myimage:v1'.
193-
Are you sure you want to continue? (y/n): y
190+
Are you sure you want to continue? (y/n):
194191
```
195192

196193
## View registry events

articles/container-registry/container-registry-faq.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ The assignee is then able to authenticate and access images in the registry.
237237

238238
* To pull an image:
239239

240-
```console
240+
```bash
241241
docker pull myregistry.azurecr.io/hello-world
242242
```
243243

@@ -293,28 +293,25 @@ grep OPTIONS /etc/sysconfig/docker
293293

294294
For instance, Fedora 28 Server has the following docker daemon options:
295295

296-
```
297-
OPTIONS='--selinux-enabled --log-driver=journald --live-restore'
298-
```
296+
`OPTIONS='--selinux-enabled --log-driver=journald --live-restore'`
299297

300298
With `--signature-verification=false` missing, `docker pull` fails with an error similar to:
301299

302-
```bash
300+
```output
303301
Trying to pull repository myregistry.azurecr.io/myimage ...
304302
unauthorized: authentication required
305303
```
306304

307305
To resolve the error:
308306
1. Add the option `--signature-verification=false` to the Docker daemon configuration file `/etc/sysconfig/docker`. For example:
309-
310-
```
311-
OPTIONS='--selinux-enabled --log-driver=journald --live-restore --signature-verification=false'
312-
```
307+
308+
`OPTIONS='--selinux-enabled --log-driver=journald --live-restore --signature-verification=false'`
309+
313310
2. Restart the Docker daemon service by running the following command:
314-
315-
```bash
316-
sudo systemctl restart docker.service
317-
```
311+
312+
```bash
313+
sudo systemctl restart docker.service
314+
```
318315

319316
Details of `--signature-verification` can be found by running `man dockerd`.
320317

@@ -474,9 +471,7 @@ az acr task list-runs -r $myregistry --run-status Running --query '[].runId' -o
474471

475472
If you pass a local source folder to the `az acr build` command, the `.git` folder is excluded from the uploaded package by default. You can create a `.dockerignore` file with the following setting. It tells the command to restore all files under `.git` in the uploaded package.
476473

477-
```sh
478-
!.git/**
479-
```
474+
`!.git/**`
480475

481476
This setting also applies to the `az acr run` command.
482477

articles/container-registry/container-registry-helm-repos.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ helm chart push mycontainerregistry.azurecr.io/helm/wordpress:latest
113113

114114
After a successful push, output is similar to:
115115

116-
```console
116+
```output
117117
The push refers to repository [mycontainerregistry.azurecr.io/helm/wordpress]
118118
ref: mycontainerregistry.azurecr.io/helm/wordpress:latest
119119
digest: 5899db028dcf96aeaabdadfa5899db025899db025899db025899db025899db02
@@ -136,7 +136,7 @@ az acr repository show \
136136

137137
Output is similar to:
138138

139-
```console
139+
```output
140140
{
141141
"changeableAttributes": {
142142
"deleteEnabled": true,
@@ -163,7 +163,7 @@ az acr repository show-manifests \
163163

164164
Output, abbreviated in this example, shows a `configMediaType` of `application/vnd.cncf.helm.config.v1+json`:
165165

166-
```console
166+
```output
167167
[
168168
{
169169
[...]
@@ -211,7 +211,7 @@ helm inspect chart wordpress
211211

212212
When no version number is provided, the *latest* version is used. Helm returns detailed information about your chart, as shown in the following condensed output:
213213

214-
```
214+
```output
215215
apiVersion: v1
216216
appVersion: 5.3.2
217217
dependencies:
@@ -251,7 +251,7 @@ helm install wordpress --generate-name
251251

252252
As the installation proceeds, follow the instructions in the command output to see the WorPress URLs and credentials. You can also run the `kubectl get pods` command to see the Kubernetes resources deployed through the Helm chart:
253253

254-
```console
254+
```output
255255
NAME READY STATUS RESTARTS AGE
256256
wordpress-1598530621-67c77b6d86-7ldv4 1/1 Running 0 2m48s
257257
wordpress-1598530621-mariadb-0 1/1 Running 0 2m48s
@@ -306,7 +306,7 @@ helm fetch stable/wordpress
306306

307307
Type `ls` to list the downloaded chart, and note the Wordpress version included in the filename. The `helm fetch stable/wordpress` command didn't specify a particular version, so the *latest* version was fetched. In the following example output, the Wordpress chart is version *8.1.0*:
308308

309-
```
309+
```output
310310
wordpress-8.1.0.tgz
311311
```
312312

@@ -318,7 +318,7 @@ az acr helm push --name mycontainerregistry wordpress-8.1.0.tgz
318318

319319
After a few moments, the Azure CLI reports that your chart is saved, as shown in the following example output:
320320

321-
```
321+
```output
322322
{
323323
"saved": true
324324
}
@@ -340,7 +340,7 @@ helm search mycontainerregistry
340340

341341
The Wordpress chart pushed in the previous step is listed, as shown in the following example output:
342342

343-
```
343+
```output
344344
NAME CHART VERSION APP VERSION DESCRIPTION
345345
helmdocs/wordpress 8.1.0 5.3.2 Web publishing platform for building blogs and websites.
346346
```
@@ -361,7 +361,7 @@ helm inspect mycontainerregistry/wordpress
361361

362362
When no version number is provided, the *latest* version is used. Helm returns detailed information about your chart, as shown in the following condensed example output:
363363

364-
```
364+
```output
365365
apiVersion: v1
366366
appVersion: 5.3.2
367367
description: Web publishing platform for building blogs and websites.
@@ -411,7 +411,7 @@ The following steps are completed during the install process:
411411

412412
As the installation proceeds, follow the instructions in the command output to see the WorPress URLs and credentials. You can also run the `kubectl get pods` command to see the Kubernetes resources deployed through the Helm chart:
413413

414-
```
414+
```output
415415
NAME READY STATUS RESTARTS AGE
416416
wordpress-1598530621-67c77b6d86-7ldv4 1/1 Running 0 2m48s
417417
wordpress-1598530621-mariadb-0 1/1 Running 0 2m48s

articles/container-registry/container-registry-tasks-multi-step.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,11 @@ az acr run --registry <acrName> -f build-push-hello-world.yaml https://github.co
9090

9191
When you run the task, the output should show the progress of each step defined in the YAML file. In the following output, the steps appear as `acb_step_0` and `acb_step_1`.
9292

93-
```console
94-
$ az acr run --registry myregistry -f build-push-hello-world.yaml https://github.com/Azure-Samples/acr-tasks.git
93+
```azurecli
94+
az acr run --registry myregistry -f build-push-hello-world.yaml https://github.com/Azure-Samples/acr-tasks.git
95+
```
96+
97+
```output
9598
Sending context to registry: myregistry...
9699
Queued a run with ID: yd14
97100
Waiting for an agent...

0 commit comments

Comments
 (0)