|
1 | 1 | --- |
2 | 2 | title: "Container Registry" |
3 | | -description: API coverage for Microsoft.ContainerRegistry in LocalStack for Azure. |
| 3 | +description: Get started with Azure Container Registry on LocalStack |
4 | 4 | template: doc |
5 | 5 | --- |
6 | 6 |
|
7 | 7 | import AzureFeatureCoverage from "../../../../components/feature-coverage/AzureFeatureCoverage"; |
8 | 8 |
|
| 9 | +## Introduction |
| 10 | + |
| 11 | +Azure Container Registry is a managed registry for storing and managing container images and related OCI artifacts. |
| 12 | +It helps you keep container images close to your deployments while controlling access and registry policies. |
| 13 | +Container Registry is commonly used as the private image source for containerized applications and CI/CD workflows. For more information, see [Azure Container Registry documentation](https://learn.microsoft.com/en-us/azure/container-registry/). |
| 14 | + |
| 15 | +LocalStack for Azure provides a local environment for building and testing applications that make use of Azure Container Registry. |
| 16 | +The supported APIs are available on our [API Coverage section](#api-coverage), which provides information on the extent of Container Registry's integration with LocalStack. |
| 17 | + |
| 18 | +## Getting started |
| 19 | + |
| 20 | +This guide is designed for users new to Container Registry and assumes basic knowledge of the Azure CLI and our `azlocal` wrapper script. |
| 21 | + |
| 22 | +Launch LocalStack using your preferred method. For more information, see [Introduction to LocalStack for Azure](/azure/getting-started/). Once the container is running, enable Azure CLI interception by running: |
| 23 | + |
| 24 | +```bash |
| 25 | +azlocal start-interception |
| 26 | +``` |
| 27 | + |
| 28 | +This command points the `az` CLI away from the public Azure management REST API and toward the LocalStack for Azure emulator API. |
| 29 | +To revert this configuration, run: |
| 30 | + |
| 31 | +```bash |
| 32 | +azlocal stop-interception |
| 33 | +``` |
| 34 | + |
| 35 | +This reconfigures the `az` CLI to send commands to the official Azure management REST API. |
| 36 | + |
| 37 | +### Create a resource group |
| 38 | + |
| 39 | +Create a resource group to contain your Container Registry resources: |
| 40 | + |
| 41 | +```bash |
| 42 | +az group create \ |
| 43 | + --name rg-acr-demo \ |
| 44 | + --location westeurope |
| 45 | +``` |
| 46 | + |
| 47 | +```bash title="Output" |
| 48 | +{ |
| 49 | + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-acr-demo", |
| 50 | + "location": "westeurope", |
| 51 | + "name": "rg-acr-demo", |
| 52 | + "properties": { |
| 53 | + "provisioningState": "Succeeded" |
| 54 | + }, |
| 55 | + ... |
| 56 | +} |
| 57 | +``` |
| 58 | + |
| 59 | +### Create a container registry |
| 60 | + |
| 61 | +Create a Basic SKU registry in the resource group: |
| 62 | + |
| 63 | +```bash |
| 64 | +az acr create \ |
| 65 | + --name acrdoc89 \ |
| 66 | + --resource-group rg-acr-demo \ |
| 67 | + --location westeurope \ |
| 68 | + --sku Basic |
| 69 | +``` |
| 70 | + |
| 71 | +```bash title="Output" |
| 72 | +{ |
| 73 | + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-acr-demo/providers/Microsoft.ContainerRegistry/registries/acrdoc89", |
| 74 | + "location": "westeurope", |
| 75 | + "name": "acrdoc89", |
| 76 | + "loginServer": "acrdoc89.azurecr.azure.localhost.localstack.cloud:4566", |
| 77 | + "provisioningState": "Succeeded", |
| 78 | + "sku": { |
| 79 | + "name": "Basic", |
| 80 | + "tier": "Basic" |
| 81 | + }, |
| 82 | + ... |
| 83 | +} |
| 84 | +``` |
| 85 | + |
| 86 | +Get and list registries: |
| 87 | + |
| 88 | +```bash |
| 89 | +az acr show \ |
| 90 | + --name acrdoc89 \ |
| 91 | + --resource-group rg-acr-demo |
| 92 | + |
| 93 | +az acr list \ |
| 94 | + --resource-group rg-acr-demo |
| 95 | +``` |
| 96 | + |
| 97 | +```bash title="Output" |
| 98 | +{ |
| 99 | + "name": "acrdoc89", |
| 100 | + "loginServer": "acrdoc89.azurecr.azure.localhost.localstack.cloud:4566", |
| 101 | + "adminUserEnabled": false, |
| 102 | + "provisioningState": "Succeeded", |
| 103 | + ... |
| 104 | +} |
| 105 | +[ |
| 106 | + { |
| 107 | + "name": "acrdoc89", |
| 108 | + "loginServer": "acrdoc89.azurecr.azure.localhost.localstack.cloud:4566", |
| 109 | + "provisioningState": "Succeeded", |
| 110 | + ... |
| 111 | + } |
| 112 | +] |
| 113 | +``` |
| 114 | + |
| 115 | +### Enable admin user and view credentials |
| 116 | + |
| 117 | +Enable the admin user on the registry: |
| 118 | + |
| 119 | +```bash |
| 120 | +az acr update \ |
| 121 | + --name acrdoc89 \ |
| 122 | + --resource-group rg-acr-demo \ |
| 123 | + --admin-enabled true |
| 124 | +``` |
| 125 | + |
| 126 | +```bash title="Output" |
| 127 | +{ |
| 128 | + "name": "acrdoc89", |
| 129 | + "adminUserEnabled": true, |
| 130 | + "provisioningState": "Succeeded", |
| 131 | + ... |
| 132 | +} |
| 133 | +``` |
| 134 | + |
| 135 | +Show admin credentials: |
| 136 | + |
| 137 | +```bash |
| 138 | +az acr credential show \ |
| 139 | + --name acrdoc89 \ |
| 140 | + --resource-group rg-acr-demo |
| 141 | +``` |
| 142 | + |
| 143 | +```bash title="Output" |
| 144 | +{ |
| 145 | + "username": "acrdoc89", |
| 146 | + "passwords": [ |
| 147 | + { |
| 148 | + "name": "password", |
| 149 | + "value": "..." |
| 150 | + }, |
| 151 | + { |
| 152 | + "name": "password2", |
| 153 | + "value": "..." |
| 154 | + } |
| 155 | + ] |
| 156 | +} |
| 157 | +``` |
| 158 | + |
9 | 159 | ## API Coverage |
10 | 160 |
|
11 | 161 | <AzureFeatureCoverage service="Microsoft.ContainerRegistry" client:load /> |
0 commit comments