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
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.
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.
Hello Community, I know this error may had been fixed years ago but I am still having the same issue which
“Error response from daemon: Get “https://registry-1.docker.io/v2/”: unauthorized: incorrect username or password” this is off course using gitlab pipeline.
I can log into the Dockerhub with the variables I stored in gitlab from command line and it was successful but with same information on the gitlab runner is throwing error of “unauthorized: incorrect username or password” with the same information
"$ echo “$REGISTRY_PASSWORD” --password | docker login --username $REGISTRY_USER --password-stdin
Though I have to use sudo docker login to make it works from command line!!
This is in combination of username and token generated as password
Is there anything I am doing wrong? please sos!!
If you can log in from command line, then isn’t this a GitLab issue? Did you try to run the exact same command that in the comand line that you used in the pipeline?
I replied because I was here anyway before going to sleep. I don’t think “sos” got a quicker response for anyone. Everyone is equally important.
You can check the GitLab forum as well
Thank you for your valuable suggestion and much appreciated. I tried multiple suggestion but your solution helped me to fix my issue.
docker login --help
```docker login --username name --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)
was having a similar problem with a fresh install of docker.
Not sure if our situations align perfectly but have you verified the email you signed up to docker with? They don’t immediately prompt you to do it upon signing up but once I verified it my login was successful
I am on windows using docker desktop and ran:
“docker login -u[username] and it should automatically bring you to the website to verify”
if you are getting authorization successful but the command line feedback says otherwise, double check that your account is verified!
you just need to run the following command
docker login -u <your_username> -p <your_password>
make sure its Read, Write, Delete or it will give an error
Thank you for mentioning that
Thank you very much, it fixed my problem, have a good one !
It works! I have to say it is a valuable answer!