Here is my situation, I have a server running artifactory (Version 4.2.1), we'll call it "artifactory.company.com" and a local repo was created as 'docker-snapshot-local'.
I have another server (CentOS 6.7) running docker and I have installed nginx reverse proxy on it, call it "docker.company.com"
If, on the docker machine, I do a wget to htp://localhost:8081/artifactory/docker-snapshot-local I get the expected output
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<head><title>Index of docker-snapshot-local/</title>
<h1>Index of docker-snapshot-local/</h1>
<pre>Name Last modified Size</pre><hr/>
<pre>No items found.
<hr/><address style="font-size:small;">Artifactory/4.2.1 Server at localhost Port 8081</address></body></html>
if I try 'docker login' such as `docker login -u my_username docker.mycompany.com:5000`
I get this back
Error response from daemon: invalid registry endpoint https://artifactory.mycompany.com:5000/v0/: unable to ping registry endpoint https://artifactory.mycompany.com:5000/v0/
v2 ping attempt failed with error: Get https://artifactory.mycompany.com:5000/v2/: dial tcp 10.10.231.114:5000: getsockopt: connection refused
v1 ping attempt failed with error: Get https://artifactory.mycompany.com:5000/v1/_ping: dial tcp 10.10.231.114:5000: getsockopt: connection refused. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry artifactory.mycompany.com:5000` 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/artifactory.mycompany.com:5000/ca.crt
I have added --insecure-registry to the docker_opts at /etc/default/docker as follows
Ensure you added your company proxy certs which also includes root and intermediate certs
Please add insecure registry in /etc/sysconfig/docker or else add your verification certs to /etc/docker/certs.d with name as you mentioned artifactory.company.com and place your verification certs inside the folder /etc/docker/certs.d/artifactory.company.com for validation.
and do execute below commands..