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

时间:2018-03-16 16:42:59

标签: docker redhat redhat-containers

我已尝试过在互联网上找到的所有解决方案,似乎无法获得解决方案..

我能够登录到不安全的注册表,因为我在/ 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

我的操作系统版本如下:Red Hat Enterprise Linux Server release 6.8 (Santiago)

我的泊坞版版本如下:

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 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)系统上成功推送到不安全注册表的技巧,我将不胜感激:)

由于

1 个答案:

答案 0 :(得分:0)

通过将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)

时,网上没有太多详细信息