Error response from daemon: Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password

I am getting this error while executing #docker login command (Error response from daemon: Get “https://registry-1.docker.io/v2/”: unauthorized: incorrect username or password). I am using Harbor as Container registry. Please help me on this.

You say that you use Harbor, but the error message shows that you tried to log in to Docker Hub. You need to specify which registry you want to log in to:

docker login --help
Log in to a Docker registry or cloud backend.
If no registry server is specified, the default is defined by the daemon.

Usage:
  docker login [OPTIONS] [SERVER] [flags]
  docker login [command]

Available Commands:
  azure       Log in to azure

Flags:
  -h, --help              Help for login
  -p, --password string   password
      --password-stdin    Take the password from stdin
  -u, --username string   username

Use "docker login [command] --help" for more information about a command.

Example:

docker login yourregistry.yourdomain.com
2 Likes

Hey, no expert here, but I tried something that worked.

I logged into the hub.docker.com account settings.

Generated a new access token which was not the same as my password. After that logged in to the docker CLI on my local server.

3 Likes

I am having the same issue. I am trying to log onto docker in my command prompt so I can access a github repository. any ideas why this won’t work? I tried changing the password and using the security token. maybe my organization blocks it? I guess I will ask my IT department.

I’m confused. Why do you want to log in to Docker Hub to access a GitHub repository? Did you want to write “Docker Hub repository”?.

no, I want to access it through docker desktop on a windows machine. But, the issue here is that my credentials won’t work.

I still don’t understand. You don’t need lto log in to Docker Hub in order to use a GitHub repository even if you want to use a container that has git in it, unless the image is private and requires authentication.

Please show an example what you are trying to do, so we can understand the issue.

This is what I am trying to do. This is directly off the github page. I have been given access.

**[Getting started]

**[Requirements]

You will need Docker installed on your development machine (e.g. Docker Desktop). If using Windows, you will need to install WSL2 and a modern-ish linux distro like Ubuntu 20.04 or similar.

Additionally, you will need to request access to dockerhub repo. Contact your manager for access.

**[Installation]

STEP 1: Clone this repo

git clone git@github.com:Redacted

STEP 2: Login to docker account

You will now login to the JAX/L7 docker account. This will allow you access to the L7 Esp docker container. Ask project manager for details.

docker login -u [Username]

You will now be asked for the password. Once logged in:

cd redacted

docker compose up -d

STEP 3: Enter container via bash
Find the container id using:

docker ps

Copy the container id and enter the shell:

docker exec -it [container id] bash

You should now be in the container bash shell.

STEP 4: Run make install
From within the project directory you will run the below command.

make install

Step 5: Login to server

Check to see if you have access at http://localhost:11702, with the default credentials. Ask a team member for default credentials.

I see. Thank you for the description. So ogging in is not for accessing the GitHub repository. You already have that and you want to use the Docker commands to pull private images defined in that GitHub repository.

Are you sure you used the right username and password when you tried to log in? Since the instructions ask you for using a commond docker account, you need a password or access token for that.