Can't login to docker hub by command

can’t login to my docker account via command

i keep getting this

[root@server ~]# 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)
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
[root@server ~]#

version
Cent OS 7
docker version
Client: Docker Engine - Community
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:03:45 2020
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 19.03.13
API version: 1.40 (minimum version 1.12)
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:02:21 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.3.7
GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683

1 Like

anyone have any ideas still can’t get this to work…???

I had a similar problem.

# docker login -u jesdynf -p <wrong password>
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password

Asher@DESKTOP-O955E5R E:\Repositories\openemr-devops\docker\openemr\6.0.0
# docker login -u jesdynf -p <right password>
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Apparently the issue was that I had to log into Docker Desktop through the GUI – once I did so I was able to push images. All attempts to log in via the CLI failed as described. Dunno if this is relevant but it’s all I’ve got.

I have a similar issue when trying to login from AWS

I also have this issue. I can’t login using the CLI (Powershell and WSL2 Ubuntu), but I can login to the website and the GUI. Other details:
1- the hello-world test:
docker run hello-world
worked
2- Despite the fact that apparently no problems were found in login of Docker Desktop, I cannot push my images to Docker Hub because username and password were denied(?).
3- I can’t create a repository in Docker Hub (when I click ‘Create Repository’ button the webpage never finishs the loading phase)

I think that the reason of this is:

1- The CLI doesn’t recognize some patterns in username/password
2- A specific connection problem of the platform

I don’t think Windows 10 has any influence on this.

I runned as administrator in Powershell and worked! :sweat_smile:

1 Like

it work properly on linux(ubuntu). I just have tu add sudo before my commands CLI and everything works properly

sudo docker login

and

sudo docker push YOUR-USERNAME/the-docker-taged-image