简体   繁体   中英

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"

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)

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 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:

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 :)

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

For anyone having the same issue... there is not much detailed online about this when using RHEL (6.8)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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