title: Dockerfile FROM Insecure Registry
body: <p>Is there a way to build a docker image from a Dockerfile that uses a base image from a local, insecure registry hosted in Gitlab. For example, if my Dockerfile were:</p>
  <pre><code>FROM insecure.registry.local:/mygroup/myproject/image:latest
  </code></pre>
  <p>When I run <code>docker build .</code> I get the following error:</p>
  <pre><code>failed to solve with frontend dockerfile.v0: failed to create LLB definition:.... http: server gave HTTP response to HTTPS client
  </code></pre>
  <p>When I've been interacting with our registry and received similar types http/https errors, I would alter the docker daemon configuration file to include:</p>
  <pre><code>   ...
     &quot;insecure-registries&quot; : [&quot;insecure.registry.local&quot;]
     ...
  </code></pre>
  <p>and everything would work when executing a particular docker command that would trigger it. I'm able to run <code>docker login insecure.registry.local</code> successfully. Is there a way either in the Dockerfile itself, through the <code>docker build</code> command or other alternative to have it pull the image successfully in the <code>FROM</code> statement from an insecure registry?</p>