title: Docker insecure registries issue on Windows Server 2016
body: <p>This is my daemon.json at C:\ProgramData\docker\config, it did not exist originally but I created manually and copied contents from my Windows 10 pro config file.</p>
  <pre><code>{
    &quot;allow-nondistributable-artifacts&quot;: [
      &quot;myregistry:5000&quot;
    ],
    &quot;experimental&quot;: true,
    &quot;insecure-registries&quot;: [
      &quot;myregistry:5000&quot;
    ],
    &quot;hosts&quot;: [
      &quot;npipe:////./pipe/docker_engine_windows&quot;
    ]
  }
  </code></pre>
  <p>I am pulling a pre-build image from the registry but keep getting the error.</p>
  <pre><code>Pulling myContainer (myregistry:5000/mycontainer:v1)...
  ERROR: Get https://myregistry:5000/v2/: http: server gave HTTP response to HTTPS client
  </code></pre>
  <p>I even tried setting insecure registries from command line flag</p>
  <pre><code>PS D:\workDir&gt; dockerd --insecure-registry &quot;myregistry:5000&quot;
  unable to configure the Docker daemon with file C:\ProgramData\docker\config\daemon.json: the following directives are specified both as a flag and in the configuration file: insecure-registries: (from flag: [myregistry:5000], from file: [myregistry:5000])
  </code></pre>
  <p>The registry server is Windows Server 2019<br />
  The same settings work fine on my Windows 10 pro machine. Only difference is that I have Docker Desktop installed on the Windows 10 machine. I am pretty new to Docker, so if I missed any info please let me know and I will edit my post and include it.</p>
  <p>Edit: I am using also creating and using a context</p>
  <pre><code>docker context create  mycontext--docker &quot;host=tcp://myregistry:2375&quot;
  docker context use mycontext
  </code></pre>