<p>I have a private registry, that it's accessed through the https protocol.
But Kubernetes + Docker, always tries to use the http protocol <a href="http://myserver.com:8080" rel="nofollow noreferrer">http://myserver.com:8080</a> instead of <a href="https://myserver.com:8080" rel="nofollow noreferrer">https://myserver.com:8080</a>.</p>

<p>How to force https protocol?</p>

<p>Snippet of my <code>yaml</code> file that declares a Pod:</p>

<pre><code>  containers:
    - name: apl
      image: myserver.com:8080/myimage
</code></pre>

<p>Details of my environment:</p>

<ul>
<li>CentOS 7.3</li>
<li>Docker 18.06</li>
<li>Kubernetes (Minikube) 1.13.1</li>
</ul>

<p>Error message in Kubernetes logs:</p>

<pre><code>  Normal   Pulling    30s (x4 over 2m2s)  kubelet, minikube  pulling image "docker.mydomain.com:30500/vision-ssh"
  Warning  Failed     30s (x4 over 2m2s)  kubelet, minikube  Failed to pull image "docker.mydomain.com:30500/vision-ssh": rpc error: code = Unknown desc = Error response from daemon: Get http://docker.mydomain.com:30500/v2/: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
  Warning  Failed     30s (x4 over 2m2s)  kubelet, minikube  Error: ErrImagePull
  Warning  Failed     19s (x6 over 2m2s)  kubelet, minikube  Error: ImagePullBackOff
  Normal   BackOff    4s (x7 over 2m2s)   kubelet, minikube  Back-off pulling image "docker.fccma.com:30500/vision-ssh"
</code></pre>

<p>If I try to specify the protocol in the name of the image, it complains: </p>

<pre><code>couldn't parse image reference "https://docker.mydomain.com:30500/vision-ssh": invalid reference format
</code></pre>

<p>Followed this <a href="https://robertbrem.github.io/Microservices_with_Kubernetes/03_Docker_registry/01_Setup_a_docker_registry/" rel="nofollow noreferrer">guide</a> in order to create the image registry.  It is already secured (HTTPS protocol and protected by user/password).</p>

david.perez
<p>In the <code>/etc/hosts</code> file, the server <code>docker.mydomain.com</code> is mapped to 127.0.0.1.  I've read in the <a href="https://docs.docker.com/engine/reference/commandline/dockerd/#insecure-registries" rel="nofollow noreferrer">docker docs</a> that local registries are always considered insecure.
If I use a name that is mapped to the external IP, then Docker tries <code>https</code>.</p>
