How-to: Push an image from docker registry to Azure Container Registry
0 min read
With the Docker registry download limits, one way to circumvent those limits is to use your own registry, such as Azure Container Registry or for short ACR. This post will show you how to save an image from a Docker registry to an Azure Container Registry.
How-To
1. Login to Azure Container Registry
Pre-requirements: have az cli installed
To login to ACR, in a command shell, type az acr login
2. Pull the image from Docker registry
In my case I wanted to push the image mcr.microsoft.com/azure-storage/azurite to my ACR.
1 |
docker pull mcr.microsoft.com/azure-storage/azurite:latest |
3. Tag the image
To upload to ACR, you need to tag the image with the proper tag: name.azurecr.io/repostority/imagename:tag
1 |
docker tag mcr.microsoft.com/azure-storage/azurite <name>.azurecr.io/azure-storage/azurite |
Latest can be daunting. So I also tagged the image with the “real” latest version number. As of this post, it is 3.9.0.
1 |
docker tag mcr.microsoft.com/azure-storage/azurite <name>.azurecr.io/azure-storage/azurite:3.9.0 |
4. Push the image to Azure Container Registry
1 2 |
docker push <name>.azurecr.io/azure-storage/azurite docker push <name>.azurecr.io/azure-storage/azurite:3.9.0 |
5. Delete the local images (Optional)
If you want you can delete the images
1 |
mcr.microsoft.com/azure-storage/azurite <name>.azurecr.io/azure-storage/azurite:3.9.0 |
Voilà!