Error when pushing image to Docker Hub

Asked 2 years ago, Updated 2 years ago, 57 views

If you push an image, it will deny access.

#docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
dockercon / test latest 896 f1 a3a36b244 hoursago 529 MB
centos latest 470671670 cac3 monthsago 237 MB

# image push
docker push dockercon/test —latest
The push references to repository [docker.io/dockercon/test]
c555f2a4fa06:Preparing 
2bfd1607c09c:Preparing 
cb764bb74596:Preparing 
2d03d772d036: Preparing 
b279b0382422: Preparing 
55b116366b5f: Waiting 
5bad68351841: Waiting 
21335377d997 - Waiting 
1a7b04ce32bf: Waiting 
88a4c5f6ce87: Waiting 
8af55873 dfab: Waiting 
0683de282177 - Waiting 
denied —Requested access to the resource is denied
  • Selinux is disabled
  • I have a Docker Hub account
  • Publish is set to public
  • Docker login before docker push
  • docker login --username* --password running
  • Docker login docker.io is also running
  • Remove ~/.docker/config.json and do docker login
  • Tried to create another repository and push it, but it was denied access
  • Registered your account with the repository co-editor
  • windows10
  • docker for windows
  • wsl (Windows Subsystem for Linux)
[root@DESKTOP-DF03I65~]#docker version
Client:
 Version 1.13.1
 API version: 1.26
 Package version: 
 Go version: go1.10.3
 Git commit: 64e9980/1.13.1
 Built: Tue Apr 28 14:43:01 2020
 OS/Arch: linux/amd64

Server:
 Version: 19.03.8
 API version: 1.40 (minimum version 1.12)
 Package version: 
 Go version: go1.12.17
 Git commit — afacb8b
 Built: Wed Mar 1101:29:16 2020
 OS/Arch: linux/amd64
 experimental:false

docker

2022-09-30 21:48

1 Answers

I think the reason is that namespace is the username. Is dockercon your username?As long as you go to https://hub.docker.com/u/dockercon, it feels like it belongs to someone else.

The way to check docker hub namespace is the username when docker login.

$docker login

Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: [username] # This will be your name space
Password:
Login Succeeded

For example, if you push https://hub.docker.com/_/hello-world into your namespace:

$docker pull hello-world
$ docker tag hello-world [ username ] / hello-world
$ docker push [ username ] / hello-world

Therefore, please check the user name.Also check the docker push document.


2022-09-30 21:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.