title: docker --insecure-registry flag not working as expected
body: <p>The instructions for private registries with self signed certs state when logging in:</p>
  
  <blockquote>
    <p>FATA[0005] Error response from daemon: v1 ping attempt failed with
    error: Get <a href="https://registry:8443/v1/_ping" rel="noreferrer">https://registry:8443/v1/_ping</a>: x509: certificate signed by
    unknown authority. If this private registry supports only HTTP or
    HTTPS with an unknown CA certificate, please add <code>--insecure-registry
    registry:8443</code> 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/registry:8443/ca.crt</p>
  </blockquote>
  
  <p>I tried that but got another error about the IP not being in the subject. So I fixed that error and now get:</p>
  
  <blockquote>
    <p>FATA[0006] Error response from daemon: Server Error: Post
    <a href="https://registry:8443/v1/users/" rel="noreferrer">https://registry:8443/v1/users/</a>: x509: certificate signed by unknown
    authority</p>
  </blockquote>
  
  <p>Where registry is the IP of the registry.</p>
  
  <p>I then placed "--insecure-registry registry:8443"  in /etc/default/docker and restarted the daemon</p>
  
  <p>I've verified it's taken the setting.</p>
  
  <blockquote>
    <p>root      6865     1  0 12:47 ?        00:00:00 /usr/bin/docker -d
    --insecure-registry registry:8443</p>
  </blockquote>
  
  <p>But docker login still produces this error:</p>
  
  <blockquote>
    <p>FATA[0006] Error response from daemon: Server Error: Post
    <a href="https://registry:8443/v1/users/" rel="noreferrer">https://registry:8443/v1/users/</a>: x509: certificate signed by unknown
    authority</p>
  </blockquote>
  
  <p>Does insecure-registry work differently than I thought and how do I get around it?</p>
  
  <p>And yes, I need HTTPS.  It's a private registry but on a public IP.  Is the only way forward to create a proper DNS entry with a real cert?</p>