<p>With dockerd running as root on the host, installed from the docker repositories, the easiest method is to configure the <a href="https://docs.docker.com/reference/cli/dockerd/#daemon-configuration-file" rel="nofollow noreferrer">file <code>/etc/docker/daemon.json</code></a> with the <a href="https://docs.docker.com/reference/cli/dockerd/#insecure-registries" rel="nofollow noreferrer">insecure-registries field</a>:</p>
<pre class="lang-json prettyprint-override"><code>{
  &quot;insecure-registries&quot;: [ &quot;185.79.96.171:8081&quot; ]
}
</code></pre>
<p>This file must be valid JSON, and may already have existing content (in which case you would add another field).</p>
<p>After editing the file, you may be able to apply the changes by reloading the docker engine with:</p>
<pre class="lang-shell prettyprint-override"><code>sudo systemctl reload docker
</code></pre>
<p>If reloading doesn't work, then a restart should be tried, which would stop running containers.</p>

CC BY-SA 4.0
2024-06-27T20:31:22.887Z
2024-06-27T20:31:22.887Z
BMitch
<p>I have two servers with no internet on them.One of them is my nexus repository with so many docker images on it.As I have no internet on them ,I can't pull any image because of no ssl configured.I get &quot;http: server gave HTTP response to HTTPS client&quot; error.Is there any way to use docker in http and pull images from my repository ? thanks</p>
<p>I tried to add DOCKER_OPTS=&quot;--insecure-registery 185.79.96.171:8081&quot; to /etc/defaults/docker but does not change anything.</p>

CC BY-SA 4.0
2024-06-27T14:20:53.303Z
How are you running docker? Installed as root on linux from the Docker repos, installed as root on Linux from one of the distributions, Docker Desktop, rootless, in snap, or some other way?
BMitch
CC BY-SA 4.0
2024-06-27T19:25:02.100Z
@Bmitch I have run it using .deb packages from docker downloadpage.I'm using ubuntu 22.04 and as root.
mahdi
<docker><nexus><http>
how to use docker with http protocol to login or pull docker images from local nexus repository?
mahdi
# how to use docker with http protocol to login or pull docker images from local nexus repository?

(Asked by: username_0 on 2024-06-27)

I have two servers with no internet on them.One of them is my nexus repository with so many docker images on it.As I have no internet on them ,I can't pull any image because of no ssl configured.I get "http: server gave HTTP response to HTTPS client" error.Is there any way to use docker in http and pull images from my repository ? thanks

I tried to add DOCKER\_OPTS="--insecure-registery 185.79.96.171:8081" to /etc/defaults/docker but does not change anything.

**Tags:** docker, nexus, http

> **Comments:**
> **username_1**: How are you running docker? Installed as root on linux from the Docker repos, installed as root on Linux from one of the distributions, Docker Desktop, rootless, in snap, or some other way?  
> **username_0**: @Bmitch I have run it using .deb packages from docker downloadpage.I'm using ubuntu 22.04 and as root.  

---

## 1 answers

### Answer by username_1 on 2024-06-27. Score: 0

With dockerd running as root on the host, installed from the docker repositories, the easiest method is to configure the file /etc/docker/daemon.json with the insecure-registries field:
{
  "insecure-registries": [ "185.79.96.171:8081" ]
}

This file must be valid JSON, and may already have existing content (in which case you would add another field).
After editing the file, you may be able to apply the changes by reloading the docker engine with:
sudo systemctl reload docker

If reloading doesn't work, then a restart should be tried, which would stop running containers.


---

