I'm trying to push images to an instance of Azure Container Registry but it keeps failing even though I have logged in successfully.
3 Answers
The tag needs to be:
azure_registry_name.azurecr.io/container-name:tag
in my case:
docker push sunlabregistry.azurecr.io/python

- 69,186
- 6
- 100
- 141

- 5,563
- 18
- 79
- 155
-
I've written [a full example](http://www.dragonbe.com/2018/02/deploy-docker-containers-fast-to.html) on using Microsoft Azure Container Registry with the SDK CLI where you can tag your container image and push it upstream. `docker tag container-name sunlabregistry.azurecr.io/container-name:tag` and `docker push acidemomvp.azurecr.io/aci-tutorial-app:v1` The rest is all explained in my step-by-step tutorial. – DragonBe Feb 12 '18 at 19:13
-
worked properly, thanks. Just a side note, if you have come here after reading to use sudo, it works as a normal user too. – Michael Staples May 18 '23 at 07:09
-
This worked great. You have to fully qualify the container registry name. You get hints that docker.io is the container registry which is default in use if you skip the domain name of the container registry in Azure. Which should be azurecr.io instead. – Tore Aurstad Aug 04 '23 at 15:25
Building on the response from Batman. In my case, I needed to follow the steps described here:
In particular, the name of the container cannot be any name we want. It needs to match the name of the repository which we have indicated when we created the "Scope map" in our container registry. To make it more concrete, let's list all the steps from creating the container registry up to doing "docker push":
Create a "Container Registry", and copy the "Login server", which in the example given by Batman is
sunlabregistry.azurecr.io
, but I use the namemy_registry.azurecr.io
In this Container Registry, create a "Token".
When creating the Token, we have a field called "Scope map". Click on "Create new"
We will get a window where we have text fields "Repository" and "Permissions". We can indicate any name we want in the text field "Repository". Let this name be
my_repository
. In the permissions, I selected all, which includes content/read, content/write.Once the Scope map has been created, we can finally generate our "Token". In the token details, select password1 or password2, and select the Generate icon.
After generating a password, copy and save it to a safe location. Azure let's you copy the full docker login command with the password included, something like:
docker login -u MyToken -p my_password my_registry.azurecr.io
Do docker login with the above command (maybe adding "sudo" at the beginning)
Tag your image as follows:
sudo docker image tag <container_id> my_registry.azurecr.io/my_repository:my_version
where
my_version
can be anything we want, butmy_repository
needs to match what we entered when creating the Token, in step 4 above.Push the tagged image as follows:
sudo docker push my_registry.azurecr.io/my_repository:my_version

- 395
- 1
- 10
First you have tag your local images with sunlabregistry.azurecr.io/python-app:v1 then use docker push /python-app:v1 tag should be mentioned.

- 5,179
- 1
- 21
- 30