0

I am facing the following issue.

I have a harbor private registry and i am trying to login through docker cli.

I am able to login successfully with: docker login <harbor_ip>. When i execute this command the cli is asking me for username and password and it logins successfully.

But when i try to login with the following command docker login -u <username> -p <password> <harbor_ip> i get the following error:

unauthorized: authentication required

Bear in mind i am using the same credentials.

Why this is happening?

MT0
  • 143,790
  • 11
  • 59
  • 117
apoellitsi
  • 249
  • 6
  • 21
  • Any special characters in your password that might break password input? Have you tried using the long notation instead of shorthand (-u and -p)? Are you absolutely sure the input is the same? What happens if you put the password in a file and use --password-stdin? – JustLudo Oct 13 '21 at 12:57

2 Answers2

2

Please wrap your username and password with single quote

docker login -u '<username>' -p '<password>' <harbor_ip>
stonezdj
  • 61
  • 3
0

when you are using haproxy or cdn infront of harbor to handle ssh termination, its important to set external_url in harbor.yml file.

it solved my problem

Aref
  • 144
  • 1
  • 7