Docker Community Forums

Share and learn in the Docker community.

Docker login (400 error)


(Sendalot) #1

I setup an insecure private registry using:

[root@docker-regi ~]#docker run --entrypoint htpasswd registry:2 -Bbn myuser mypassword > /auth/htpasswd
[root@docker-regi ~]#docker run -d -p 5000:5000 --restart=always --name registry_auth  -v `pwd`/auth:/auth  -e "REGISTRY_AUTH=htpasswd"  -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm"  -e "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd"  registry:2

But when trying to login:

[root@docker-remote ~]# !748
docker login -u myuser -p mypassword
Error response from daemon: login attempt to failed with status: 400 Bad Request
[root@docker-remote ~]# 

Referred to &&


The password file path is wrong.
In your first cmd ,the path is /auth/htpasswd, but in your second cmd, the path is /root/auth/htpasswd,
they are not the same one, so the registry can not find right password file.