Docker push mirror failure resolution

  • 2020-05-27 07:53:03
  • OfStack

Problem with Docker push mirror failure.

Here is a failure after entering push's own tomcat


[root@slave3 ~]# docker push lekkoliu/tomcat8:latest
The push refers to a repository [docker.io/lekkoliu/tomcat8]
cefee3f6c961: Preparing 
82f021d9c2b9: Preparing 
4f91f02b4e49: Preparing 
a4b3ce7e1d4a: Preparing 
c3b95f8496f1: Preparing 
bcfb53b3ff7c: Waiting 
3aa267e87e63: Waiting 
6c0ce72ad569: Waiting 
3242004f198a: Waiting 
b2ac5371e0f2: Waiting 
142a601d9793: Waiting 
unauthorized: authentication required

Here is what has been done: changing private hub to public does not solve this problem.

Solutions:

In particular, if you don't name it the right way, it won't work.

Take my own:

The official hub I applied for in docker is:


PRIVATE REPOSITORY
lekko/liu

When executing local docker push, the name of image should be changed to conform to the specification (docker tag username/userimage) using the command docker tag.

Such as:


[root@slave3 ~]# docker tag lekko/liu/tomcat8 lekko/tomcat8

I thought username was my whole name, lekko/liu. Later, after many tests, I found out that username here refers to the account I applied for, that is, lekko in my lekko/liu.

At this point, the modified image name is lekko/tomcat8, as shown in the code above.

So just take this image push out here.


[root@slave3 ~]# docker push lekko/tomcat8
The push refers to a repository [docker.io/lekko/tomcat8]
cefee3f6c961: Layer already exists 
82f021d9c2b9: Layer already exists 
4f91f02b4e49: Layer already exists 
a4b3ce7e1d4a: Layer already exists 
c3b95f8496f1: Layer already exists 
bcfb53b3ff7c: Layer already exists 
3aa267e87e63: Layer already exists 
6c0ce72ad569: Layer already exists 
3242004f198a: Layer already exists 
b2ac5371e0f2: Layer already exists 
142a601d9793: Layer already exists 
latest: digest: sha256:4c878796e09584128e4eb3a17c9d6cb66c33e3678db377aa1921110116e2b4da size: 2625

At this point, you can use the docker server to fetch the image you just uploaded:


[root@master ~]# docker pull lekko/tomcat8
Using default tag: latest
latest: Pulling from lekko/tomcat8
6a5a5368e0c2: Pull complete 
7b9457ec39de: Pull complete 
d5cc639e6fca: Pull complete 
dae3b0638638: Pull complete 
ab678d1c6f00: Pull complete 
d5bf826c3153: Pull complete 
0081bad1df81: Pull complete 
8fafa3f26de4: Pull complete 
ae984359ed7e: Pull complete 
9175a2e1674f: Pull complete 
2e8f15e74426: Pull complete 
Digest: sha256:4c878796e09584128e4eb3a17c9d6cb66c33e3678db377aa1921110116e2b4da
Status: Downloaded newer image for lekko/tomcat8:latest

Thank you for reading, I hope to help you, thank you for your support of this site!


Related articles: