Created
December 2, 2016 13:44
-
-
Save ppatierno/36467ffdeff3ce746068ab0b39a96aac to your computer and use it in GitHub Desktop.
How to specify --insecure-registry needed for OpenShift "cluster up"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It could happen that with your Docker installation you don't have the following configuration file : | |
/etc/sysconfig/docker | |
Without it, the Docker daemon started as a service (i.e. with systemd so using "sudo systemctl start docker" or | |
"sudo systemctl enable docker" to start at OS startup) gets the configuration from following file : | |
/usr/lib/systemd/system/docker.service | |
You can ovveride this configuration in the following way : | |
1. create /etc/systemd/system/docker.service.d directory | |
2. create /etc/systemd/system/docker.service.d/docker.conf file | |
Now docker.conf becomes the configuration file used by Docker daemon on startup. You can start just copying the same configuration | |
from the default file but it's important to add the following line : | |
ExecStart= | |
before your real ExecStart. It's needed to clear the predefined ExecStart in the default file in order to use the new one. | |
Without this line, you could have following error on starting Docker : | |
docker.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing. | |
So, for example, in order to add --insecure-registry command line options to the Docker daemon start, you could have : | |
ExecStart= | |
ExecStart=/usr/bin/dockerd --insecure-registry 172.30.0.0/16 | |
After changing the configuration with a custom docker.conf file, you need to flush changes : | |
sudo systemctl daemon-reload | |
and then restart Docker : | |
sudo systemctl restart docker | |
Of course, the other way is not having Docker daemon running as a service but starting it directly from command line with : | |
sudo dockerd --insecure-registry 172.30.0.0/16 |
Thank you it really works fine guys, cg-cnu that way is very quick and simple.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or you can simply add the ip address in the
/etc/docker/daemon.json
file as below...