Docker not logging into local repository

  docker, local, nexus, repository

I have just set up a local VM running Nexus. I have configured a Docker repository on port 5000. I have a separate VM running Docker. I have configured the repository in /etc/docker/daemon.json as so:

{
  "insecure-registries": ["192.168.0.5:5000", "nexus:5000"]
}

I then restarted the Docker service. and I have run the command:

docker login 192.168.0.5:5000

I am prompted for a username and password, and when I enter them it returns with::

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

I have checked the Docker documentation, and other online resources on how to login to a local docker repository, but I have exactly the same configuration and it just always throws this error.

If I try to push my image, it attempts to contact the local repository, but it complains there are no credentials (as well it should):

[[email protected] repo]$ docker tag repo 192.168.0.5:5000/repo
[[email protected] repo]$ docker image push 192.168.0.5:5000/repo
Using default tag: latest
The push refers to repository [192.168.0.5:5000/repo]
7d5760c4aa8d: Preparing
3102e53269f4: Preparing
2f140462f3bc: Preparing
63c99163f472: Preparing
ccdbb80308cc: Preparing
no basic auth credentials

Am I missing something?

Source: Docker Questions

LEAVE A COMMENT