Clicking a docker image on a new docker node account

I need to change the Docker Hub account that I click on my images. I used docker login to update my .dockercfg file and then did the following ( account , image and tag actions as common placeholders for my actual values):

docker push account/image:tag

I immediately get the following error:

 The push refers to a repository [account/image] (len: 1) Sending image list 2014/12/11 21:26:59 Error: Status 400 trying to push repository repo/image: "Access denied: <hash> is a private image" docker push account/image:tag returned exit code 1action docker push repo/image:tag failed 

I am trying to click on a private repository on a docker hub, but I have double-checked whether my auth matches. Why is this failing and how can I fix it?

+5
source share
5 answers

I still don't quite understand why this happened, but I figured out how to fix it. I destroyed all the images and containers on my local machine and restored the image. After that, I was able to click on the new account.

My theory is that the Docker image that I originally created depended on the levels that existed in previous builds, and that the old account was available. As soon as I switched to a new account, I tried to click on an image that depended on layers that no longer existed in the Docker Hub, as a result of which this layer was not found, which made the Docker Hub think that I was trying to access should be private when it was actually not there.

All of the above is a pretty clear guess, so I would be happy to be enlightened by someone with a lot of knowledge and / or experience in this area.

0
source

I had the same problem and the reason turned out to be a private parent image. As explained here , your image is built on top of the base image and, in most cases, parent images. When you try to insert your latest changes into the docker hub, your account must have access to all the parent images, otherwise this will result in this error. In my case, the user I was trying to click did not have access to the image that I used as the base.

You can easily identify a personal image by its hash.

 docker images -a | grep <hash> 

If you have access to a private repository, you can fix this by adding the user you click to the collaborator list. However, if you do not, you will have to tag the private repository for your user and apply the rest of the changes manually.

Hope this helps;)

0
source

I have the same problem here. In my case, I had a "FROM ubuntu: last" instruction in the Dockerfile. In this case, I created the image using my old account, and to this I downloaded ubuntu: the last to create it, but this download was done using my previous account, so I just deleted ubuntu: the last (it was the base image ) from my computer and built the image again. After that, I was able to push the image.

0
source

I ran into this problem and Bruno's comment seems to fix it. Here's a quick bash comment for deleting your images (assuming you have DockerFiles and automation to recreate them): Docker Photos | awk '{print $ 3}' | xargs docker rmi -f

0
source

I used the latest Docker created with ubuntu: true when this happened. Deleting all images did not help. I changed the parent image tag from reliable to an older trusty-20150630.

0
source

Source: https://habr.com/ru/post/1208913/


All Articles