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

Docker: unable to push to insecure private registry

我已经尝试了我在互联网上找到的所有修复程序,但似乎无法找到解决方案..

我能够登录到不安全的注册表,因为我在 /etc/sysconfig/docker 文件中有以下内容: other_args="--insecure-registry http://10.3.31.105 --insecure-registry http://harbor.ie.local"

这是我的登录示例:

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

我的OS版本如下:Red Hat Enterprise Linux Server release 6.8 (Santiago)

我的docker版本如下:

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

我尝试推送的图片如下:

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

我的docker推送尝试如下:

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

如您所见,它甚至不尝试通过 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'.

因此,如果有人知道在 RedHat (6.8) 系统上成功推送到不安全注册表的技巧,我将不胜感激:)

谢谢

所以通过将我的 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

来解决问题

对于遇到相同问题的任何人...使用 RHEL (6.8) 时在线上没有太多详细信息