简体   繁体   English

Docker:无法推送不安全的私有注册表

[英]Docker: unable to push to insecure private registry

I have tried every fix that I have found on the internet and cant seem to get a solution.. 我已经尝试了在互联网上找到的所有修复程序,但似乎无法找到解决方案。

I am able to login to the insecure registry because I have the following in the /etc/sysconfig/docker file: other_args="--insecure-registry http://10.3.31.105 --insecure-registry http://harbor.ie.local" 我可以登录到不安全的注册表,因为/ etc / sysconfig / other_args="--insecure-registry http://10.3.31.105 --insecure-registry http://harbor.ie.local"文件中包含以下内容: other_args="--insecure-registry http://10.3.31.105 --insecure-registry http://harbor.ie.local" : other_args="--insecure-registry http://10.3.31.105 --insecure-registry http://harbor.ie.local"

Here is my login example: 这是我的登录示例:

docker login --username USERNAME --password 'PASSWORD' http://10.3.31.105
WARNING: login credentials saved in /home/svc.jenkins/.docker/config.json
Login Succeeded

My OS version is as follows: Red Hat Enterprise Linux Server release 6.8 (Santiago) 我的操作系统版本如下: Red Hat Enterprise Linux Server release 6.8 (Santiago)

My docker version is as follows: 我的泊坞窗版本如下:

docker version
Client version: 1.7.0
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 0baf609
OS/Arch (client): linux/amd64
Server version: 1.7.0
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 0baf609
OS/Arch (server): linux/amd64

The image that I am trying to push is as follows: 我要推送的图像如下:

10.3.31.105/okreach/springboot latest cb4b8dccc4fd 5 hours ago 292.1 MB

My docker push attempt is as follows: 我的docker push尝试如下:

docker push 10.3.31.105/okreach/springboot:latest
Error response from daemon: invalid registry endpoint https://10.3.31.105/v0/: unable to ping registry endpoint https://10.3.31.105/v0/
v2 ping attempt failed with error: Get https://10.3.31.105/v2/: dial tcp 10.3.31.105:443: connection refused
 v1 ping attempt failed with error: Get https://10.3.31.105/v1/_ping: dial tcp 10.3.31.105:443: connection refused. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 10.3.31.105` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/10.3.31.105/ca.crt

As you can see, it does not even attempt connecting via http... only https... and adding --insecure-registry as an argument does not work out too well for me: 如您所见,它甚至没有尝试通过http ...仅https ...进行连接,并添加--insecure-registry作为参数对我来说效果不佳:

docker push --insecure-registry=10.3.31.105 10.3.31.105/okreach/springboot:latest
flag provided but not defined: --insecure-registry
See 'docker push --help'.

So if anyone knows the trick to get a successful push to an insecure registry on a RedHat (6.8) system, I would appreciate it :) 因此,如果有人知道成功推送到RedHat(6.8)系统上不安全的注册表的技巧,我将不胜感激:)

Thanks 谢谢

So problem fixed by changing my other_args="--insecure-registry http://10.3.31.105 --insecure-registry http://harbor.ie.local to this other_args="--insecure-registry http://10.3.31.105 --insecure-registry 10.3.31.105 因此,通过将我的other_args="--insecure-registry http://10.3.31.105 --insecure-registry http://harbor.ie.local更改为此other_args="--insecure-registry http://10.3.31.105 --insecure-registry 10.3.31.105

For anyone having the same issue... there is not much detailed online about this when using RHEL (6.8) 对于有相同问题的任何人,在使用RHEL(6.8)时,在线上对此没有太多详细介绍

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

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