HostOnNet Blog

Error: did not detect an –insecure-registry argument on the Docker daemon

When i installed OpenShift on Ubuntu 16.04, i get following error

root@hon-pc-01:~# oc cluster up
-- Checking OpenShift client ... OK
-- Checking Docker client ... OK
-- Checking Docker version ... OK
-- Checking for existing OpenShift container ... OK
-- Checking for registry.access.redhat.com/openshift3/ose:v3.4.1.2 image ... 
   Pulling image registry.access.redhat.com/openshift3/ose:v3.4.1.2
   Pulled 1/4 layers, 25% complete
   Pulled 2/4 layers, 50% complete
   Pulled 3/4 layers, 75% complete
   Pulled 4/4 layers, 100% complete
   Extracting
   Image pull complete
-- Checking Docker daemon configuration ... FAIL
   Error: did not detect an --insecure-registry argument on the Docker daemon
   Solution:

     Ensure that the Docker daemon is running with the following argument:
        --insecure-registry 172.30.0.0/16

root@hon-pc-01:~# 

I edited /etc/default/docker, added line

DOCKER_OPTS="--insecure-registry 172.30.0.0/16"

But for some reason, docker will not take this after i restart.

This is fixed by editing systemd unit for docker at

vi /etc/systemd/system/multi-user.target.wants/docker.service

Find

/usr/bin/dockerd -H fd:// 

Replace with

/usr/bin/dockerd --insecure-registry 172.30.0.0/16 -H fd:// 

Now reload systemd

systemctl daemon-reload

Restart docker

systemctl stop docker
systemctl start docker

Posted in Linux

  • raman singh

    Although above given solution is correct but a small mistake is there i.e. absence of “=” operator. please try the below one:

    Solution of the problem is :
    1. go to path :
    vi /etc/systemd/system/multi-user.target.wants/docker.service
    2. In [Service] section :
    under parameter :
    ExecStart=/usr/bin/dockerd-current
    –add-runtime docker-runc=/usr/libexec/docker/docker-runc-current
    –default-runtime=docker-runc
    –exec-opt native.cgroupdriver=systemd
    –userland-proxy-path=/usr/libexec/docker/docker-proxy-current

    #after this add the line given below :

    “–insecure-registry=172.30.0.0/16 ”

    3. save the file
    4. systemctl daemon-reload
    5. systemctl stop docker
    6. systemctl start docker