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": ["", "nexus:5000"]

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

docker login

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

Error response from daemon: Get 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
[[email protected] repo]$ docker image push
Using default tag: latest
The push refers to repository []
7d5760c4aa8d: Preparing
3102e53269f4: Preparing
2f140462f3bc: Preparing
63c99163f472: Preparing
ccdbb80308cc: Preparing
no basic auth credentials

Am I missing something?

Source: Docker Questions