In this lab, you'll push the Docker image you created locally to Azure Container Registry (ACR).
- Docker image created locally
- Access to an Azure Container Registry
- Log Into the ACR Repository
🔍 Note: Replace
devopsthehardwayazurecr
with your actual ACR name.
az acr login --name devopsthehardwayazurecr
- Tag the Docker Image
🔍 Note: Ensure to replace
devopsthehardwayazurecr
with your ACR name andv1
with the appropriate version tag if needed.
docker tag thomasthorntoncloud devopsthehardwayazurecr.azurecr.io/thomasthorntoncloud:v1
-
Push the Docker Image to ACR
docker push devopsthehardwayazurecr.azurecr.io/thomasthorntoncloud:v1
After pushing the image to ACR, consider these questions:
- Why do we need to tag the Docker image before pushing it to ACR?
- What's the significance of the version tag (e.g.,
v1
) in the image name? - How does ACR authentication work when pushing images?
To ensure the Docker image was successfully pushed to ACR:
- Log into the Azure Portal.
- Navigate to your Azure Container Registry
- Check the "Repositories" section to see if your image is listed:
Consider setting up CI/CD pipelines to automatically build and push your Docker images to ACR whenever you make changes to your application code.