0

Do you have a solution to the docker insecure repo! http response instead of https!

I'm getting this upon trying to post to the docker repo on nexus, (v = nexus-3.22.0-02)

Docker-details:

 Version:           19.03.6
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        369ce74a3c
 Built:             Fri Feb 28 23:45:43 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.6
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       369ce74a3c
  Built:            Wed Feb 19 01:06:16 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.3.3-0ubuntu1~18.04.1
  GitCommit:        
 runc:
  Version:          spec: 1.0.1-dev
  GitCommit:        
 docker-init:
  Version:          0.18.0
  GitCommit:        

Error: http: server gave HTTP response to HTTPS client, this happened as I try to push to repo!

I have already adjusted the '/etc/docker/daemon.json' to this:

{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2",
"insecure-registries": ["localhost:8122/repository/k8s-2020-b-docker-repo01"],
"insecure-registries": ["localhost:8123/repository/k8s-2020-b-docker-repo02"],
"insecure-registries": ["localhost:8124/repository/k8s-2020-b-docker-repo03"],
"insecure-registries": ["localhost:8122"],
"insecure-registries": ["localhost:8123"],
"insecure-registries": ["localhost:8124"],
"insecure-registries": ["ip-10-7-1-26.eu-west-1.compute.internal:8122"],
"insecure-registries": ["ip-10-7-1-26.eu-west-1.compute.internal:8123"],
"insecure-registries": ["ip-10-7-1-26.eu-west-1.compute.internal:8124"],
"insecure-registries": ["k8s-2020-b-docker-repo:8122"],
"insecure-registries": ["k8s-2020-b-docker-repo:8123"],
"insecure-registries": ["k8s-2020-b-docker-repo:8124"],
"insecure-registries": ["127.0.0.1:8122"],
"insecure-registries": ["127.0.0.1:8123"],
"insecure-registries": ["127.0.0.1:8124"],
}
morawi
  • 1

1 Answers1

0

I had this and it was happening because my https-aware Nexus instance was not liking my use of the http connector. As soon as I addressed it using an https connector everything worked perfectly. This link using-nexus-3-as-your-repository might help you. Follow the instructions but create also an https connector (ie 8083 http and 8883 https) and try both with your login.

Hint, your usage of the machine name in docker login needs to match either the nexus server certificate CN or a SAN exactly. So docker login -u <user> -p <pass> fred.foo.bar:8883 where your nexus server certificate's CN is for CN=fred.foo.bar....

bigbadmouse
  • 216
  • 1
  • 11