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