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
Azure Container Registry is a managedregistry 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/).
11
+
Azure Container Registry (ACR) is a managed, private OCI-compatible registry for storing and managing container images and Helm charts.
12
+
It integrates natively with Azure Kubernetes Service, Azure Container Instances, and Azure App Service to streamline container-based application deployments.
13
+
ACR is commonly used to build, store, and manage container images as part of a continuous integration and deployment pipeline. For more information, see [Azure Container Registry documentation](https://learn.microsoft.com/en-us/azure/container-registry/).
14
14
15
15
LocalStack for Azure provides a local environment for building and testing applications that make use of Azure Container Registry.
16
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
17
18
18
## Getting started
19
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.
20
+
This guide walks you through creating a registry, logging in with Docker, pushing an image, and listing repositories. It assumes basic knowledge of the Azure CLI and our `azlocal` wrapper script.
21
21
22
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
23
@@ -58,18 +58,20 @@ az group create \
58
58
59
59
### Create a container registry
60
60
61
-
Create a Basic SKU registry in the resource group:
Authenticate the local Docker daemon to the registry using the Azure CLI:
91
+
92
+
```bash
93
+
az acr login --name acrdoc89
94
+
```
95
+
96
+
The emulator does not issue an AAD challenge, so the CLI prints an informational warning before confirming `Login Succeeded`. This is expected behaviour.
97
+
98
+
### Build and push an image
99
+
100
+
Create a minimal `Dockerfile` for the demo image:
101
+
102
+
```bash
103
+
cat > Dockerfile <<'EOF'
104
+
FROM alpine:latest
105
+
CMD ["echo", "Hello from LocalStack ACR!"]
106
+
EOF
107
+
```
108
+
109
+
Capture the registry login server returned by the emulator, then build and push the image using that address:
List repositories (image names) in the registry—for example, after you push an image in [Build and push an image](#build-and-push-an-image), the repository name (without a tag) appears here:
173
+
174
+
```bash
175
+
az acr repository list \
176
+
--name acrdoc89 \
177
+
--output table
178
+
```
179
+
180
+
```text title="Output"
181
+
Name
182
+
---------------
183
+
hello
184
+
```
116
185
117
-
Enable the admin user on the registry:
186
+
### Check name availability
187
+
188
+
Registry names are globally unique in Azure. The following example shows the result when the name is already in use (for example, after you have created the registry):
189
+
190
+
```bash
191
+
az acr check-name --name acrdoc89
192
+
```
193
+
194
+
```bash title="Output"
195
+
{
196
+
"message": "The registry acrdoc89 is already in use.",
197
+
"nameAvailable": false,
198
+
"reason": "AlreadyExists"
199
+
}
200
+
```
201
+
202
+
### Update registry settings
203
+
204
+
Turn off the registry admin user (for example, to rely on other auth modes in your workflow):
205
+
206
+
```bash
207
+
az acr update --name acrdoc89 --resource-group rg-acr-demo --admin-enabled false
Re-enable the admin user on the registry (for example, after you disabled it in [Update registry settings](#update-registry-settings)), so you can retrieve admin credentials:
118
246
119
247
```bash
120
248
az acr update \
@@ -156,6 +284,42 @@ az acr credential show \
156
284
}
157
285
```
158
286
287
+
## Delete and verify
288
+
289
+
Delete the registry and remove the demo `Dockerfile` created earlier:
290
+
291
+
```bash
292
+
az acr delete --name acrdoc89 --resource-group rg-acr-demo --yes
293
+
rm -f Dockerfile
294
+
```
295
+
296
+
## Features
297
+
298
+
- **Full CRUD lifecycle:** Create, read, update, and delete registry resources using the Azure CLI or ARM API.
299
+
- **Admin user management:** Enable or disable admin user access and retrieve admin credentials.
300
+
- **Name availability check:** Validate registry name uniqueness via `az acr check-name`.
301
+
- **Image push and pull:** Push and pull OCI-compliant container images using the standard Docker CLI.
302
+
- **In-registry builds:** Build images directly in the emulated registry using `az acr build`.
303
+
- **Repository listing:** List repositories and image tags stored in the registry.
304
+
- **Registry usage reporting:** Retrieve storage and limit usage via `az acr show-usage`.
305
+
- **Registry update:** Modify registry properties such as admin enabled and SKU.
306
+
- **Multiple SKUs accepted:** Basic, Standard, and Premium SKU names are accepted (all backed by the same local registry).
307
+
308
+
## Limitations
309
+
310
+
- **Geo-replication not supported:** Multi-region registry replication is not emulated.
311
+
- **ACR Tasks beyond basic build:** Task scheduling, triggers, and multi-step task workflows are mocked at the ARM level but not executed.
312
+
- **Private endpoints for ACR:** Private Link–based network isolation is not supported.
313
+
- **Webhook notifications:** Registry webhooks defined via the ARM API are stored but not fired on push events.
314
+
- **Content trust and quarantine:** Image signing and quarantine policies are not enforced.
315
+
- **Delete is not persisted:**`az acr delete` returns HTTP 200 and exits cleanly, but the registry record is not removed from the in-memory store in the current emulator version.
316
+
317
+
## Samples
318
+
319
+
The following sample demonstrates how to use Azure Container Registry with LocalStack for Azure:
320
+
321
+
- [Azure Container Instances, Key Vault, and Storage](https://github.com/localstack/localstack-azure-samples/blob/main/samples/aci-blob-storage/python/README.md)
0 commit comments