# Docker registry login failure

**URL:** <https://community.sonatype.com/t/docker-registry-login-failure/1786>\
**Category:** Sonatype Nexus Repository\
**Tags:** docker\
**Created:** [May 14, 2019, 2:07pm UTC](https://community.sonatype.com/t/docker-registry-login-failure/1786 "2019-05-14T14:07:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil.ruff](https://avatars.discourse-cdn.com/v4/letter/p/13edae/32.png) [@phil.ruff](https://community.sonatype.com/u/phil.ruff)\
**Post date:** [May 14, 2019, 2:07pm UTC](https://community.sonatype.com/t/docker-registry-login-failure/1786/1 "2019-05-14T14:07:11Z")

</div>

My goal is to stand up Nexus Repository Manager and configure it as a Docker registry via script. I am deploying this in a kubernetes cluster and intend to use the helm chart.

The below is me testing it on my local machine via docker and virtualbox.

I stand up a nexus repository manager, successfully use the API to create a Docker internal repo and fail to be able to log in to the Docker registry and therefore am not able to push and pull images to it.

I have been testing this on Docker on the desktop with the GitHub repo from Sonatype classhttps://github.com/CMYanko/nexus-platform-reference

I create the repository using the following repohttps://github.com/sonatype-nexus-community/nexus-scripting-examples

Create.sh docker.json

Run.sh docker

List.sh

Docker.json

{

"name":"docker",

"type":"groovy",

“content”:“repository.createDockerHosted(‘docker-internal’,null, null)”

}

Docker login[192.168.99.100:8081/repository/docker-internal](http://192.168.99.100:8081/repository/docker-internal) –u admin –p admin123

Error msg is …

docker login[192.168.99.100:8081](http://192.168.99.100:8081) -u admin -p admin123

WARNING! Using --password via the CLI is insecure. Use --password-stdin.

Error response from daemon: Gethttps://192.168.99.100:8081/v2/: http: server gave HTTP response to HTTPS client

---

<div class="post-metadata">

**Author:** ![rseddon](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/rseddon/32/341_2.png) [@rseddon](https://community.sonatype.com/u/rseddon)\
**Post date:** [May 14, 2019, 4:35pm UTC](https://community.sonatype.com/t/docker-registry-login-failure/1786/2 "2019-05-14T16:35:53Z")

</div>

There are a few problems here. First, you can’t connect using “/repository/docker-internal”, because docker registries can only run on context path “/”. You’ll need to define a connector port in the repository configuration, and use that to connect.

See here for other strategies you can use to work around this limitation:

> **[Docker Repository Configuration and Client Connection](https://support.sonatype.com/hc/en-us/articles/115013153887-Docker-Repository-Configuration-and-Client-Connection)**
>
> .
> This article describes the process of configuring Docker repository connectors to allow a Docker client to connect to a Nexus 3 Docker repository.  
> What is a Repository Connector?
> When you make ...

Second, docker by default requires https connections from registries. And it is somewhat picky about the certificates it allows. You can try using the “–insecure” flag to work around that, but a better solution is here:

> **[Using Self-Signed Certificates with Nexus Repository and Docker Daemon](https://support.sonatype.com/hc/en-us/articles/217542177-Using-Self-Signed-Certificates-with-Nexus-Repository-and-Docker-Daemon)**
>
> .
> 
> Background
> A private Docker registry such as Nexus Repository 3 will require authentication from your users in order to publish Docker images. In order to use authentication, the Docker Daemon i...

Rich
