ACR allows you to store containers in the cloud (Azure version of Dockerhub)
Service to store your own private Docker registries More secure than docker hub
- you set permissions
- you can sign images
- images are encrypted
Create with CLI or in the portal
az acr create --name myregistry --resource-group mygroup --sku standard --admin-enabled true
ACR stores images, but can also be used to build images.
az acr build --file Dockerfile --registry myregistry --image myimage .
this command sends the folder to AZ, which uses the dockerfile to build the image. The . at the end is the path
Created ACR in portal, clone repo and push the contents using the CLI
Web app from docker image needs the following
- the registry (ACR, docker hub)
- the image
- the tag (latest is the convention)
- startup file (exe or command to run)
Like creating a regular web app, except you pick container. The wizard then lets you pick your image from the ACR registry. When you click create, AZ pulls from the container and the site is live.
App Service subscribes to ACR to rec. notifications that something has changed, then the new version is automatically pulled in and deployed.
Use to rebuild image whenever source changes.
On the container settings page you pick continuous deployment
Tasks must be created from the command line using az acr task create
az acr task create --registry <container_registry_name> --name buildwebapp --image webimage --context https://github.com/MicrosoftDocs/mslearn-deploy-run-container-app-service.git --branch master --file Dockerfile --git-access-token <access_token>
This creates a task called buildwebapp which monitors GH. When changes are checked in, the task runs.
Made a change to source code, pushed changes to ACR. ACR built the image and the webhook was triggered and the site was updated.