简体   繁体   English

作为 docker 存储库的 nexus

[英]nexus as a docker repository

Do you have a solution to the docker insecure repo!你有解决 docker insecure repo 的方法吗! http response instead of https! http 响应而不是 https!

I'm getting this upon trying to post to the docker repo on nexus, (v = nexus-3.22.0-02)我在尝试发布到 nexus 上的 docker 存储库时得到了这个,(v = nexus-3.22.0-02)

Docker-details: Docker-详细信息:

 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!错误:http:服务器向 HTTPS 客户端提供 HTTP 响应,这是在我尝试推送到 repo 时发生的!

I have already adjusted the '/etc/docker/daemon.json' to this:我已经将 '/etc/docker/daemon.json' 调整为:

{
"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"],
}

I had this and it was happening because my https-aware Nexus instance was not liking my use of the http connector.我有这个并且它正在发生,因为我的 https-aware Nexus 实例不喜欢我使用http连接器。 As soon as I addressed it using an https connector everything worked perfectly.一旦我使用https连接器解决它,一切都运行良好。 This link using-nexus-3-as-your-repository might help you.这个链接using-nexus-3-as-your-repository可能对你有帮助。 Follow the instructions but create also an https connector (ie 8083 http and 8883 https) and try both with your login.按照说明操作,但还要创建一个 https 连接器(即 8083 http 和 8883 https),然后用您的登录名尝试两者。

Hint, your usage of the machine name in docker login needs to match either the nexus server certificate CN or a SAN exactly .提示,您在 docker login 中使用的机器名称需要与 nexus 服务器证书 CN 或 SAN完全匹配。 So docker login -u <user> -p <pass> fred.foo.bar:8883 where your nexus server certificate's CN is for CN=fred.foo.bar....所以docker login -u <user> -p <pass> fred.foo.bar:8883你的 nexus 服务器证书的 CN 是 CN=fred.foo.bar....

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM