Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker: " login attempt to https://hub.docker.com/v2/ failed with status: 404 Not Found" in Fedora 25

I have Docker CE installed in Fedora 25.

When I try to login into docker hub using below command I am getting error.

$ docker login --username xxx --password yyy https://hub.docker.com/
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: login attempt to 
https://hub.docker.com/v2/ failed with status: 404 Not Found

$ docker --version
 Docker version 17.07.0-ce, build 8784753

$ docker-machine --version
 docker-machine version 0.12.2, build 9371605

Notice that the same command works fine in Ubuntu 16.04 Only difference I can think of is ubuntu have docker and fedora have docker-ce.

Not sure why I get this error only on Fedora. I get this this error when Fedora is installed on virtual box VM.

like image 466
Rajkumar Natarajan Avatar asked Sep 06 '17 04:09

Rajkumar Natarajan


3 Answers

You need not specify the registry when it is hub.docker.com.

docker login --username xxx --password yyy

Use above command without URL and it should work

like image 162
Tarun Lalwani Avatar answered Sep 19 '22 06:09

Tarun Lalwani


Docker Hub is the default registry, so there's no need to specify the registry (i.e., just docker login --username .... is sufficient).

However, the reason you're getting this error, is because hub.docker.com is the domain of the Docker Hub website, not the registry backing Docker Hub; the registry is located at index.docker.io, (e.g. docker login index.docker.io).

In short, run command like below

PS D:> 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: Password: Login Succeeded PS D:>

like image 41
Santosh Ganacharya Avatar answered Sep 20 '22 06:09

Santosh Ganacharya


I had a similar issue when setting up a Jenkins pipeline for a Docker application.

The issue was that I was in my Jenkinsfile build stage I was using https://hub.docker.com as the registry for Docker:

stage('Push image') {
  /* Finally, we'll push the image with two tags:
  * First, the incremental build number from Jenkins
  * Second, the 'latest' tag.
  * Pushing multiple tags is cheap, as all the layers are reused. */
  docker.withRegistry('https://hub.docker.com', 'Dockerhub') {
    app.push("${env.BUILD_NUMBER}")
    app.push("latest")
  }
}

Here's how I fixed it:

I simply had to modify the docker registry from https://hub.docker.com to https://registry.hub.docker.com:

stage('Push image') {
  /* Finally, we'll push the image with two tags:
  * First, the incremental build number from Jenkins
  * Second, the 'latest' tag.
  * Pushing multiple tags is cheap, as all the layers are reused. */
  docker.withRegistry('https://registry.hub.docker.com', 'Dockerhub') {
    app.push("${env.BUILD_NUMBER}")
    app.push("latest")
  }
}

And then for my Dockerhub credentials in Jenkins Configuration:

username: my_username (not my email address)
password: my_password

That's all.

I hope this helps.

like image 39
Promise Preston Avatar answered Sep 17 '22 06:09

Promise Preston