Unable to pull Docker images from private registry using Rancher

8/3/2017

I am new to Docker, Rancher and Kubernetes. I am using RancherOS and have installed Rancher server on it. When i try to connect a node to Rancher server, it connects fine but when Kubernetes tries to start services, most of the services fail with errors similar to the following:

Error (Image [index.docker.io/rancher/net:v0.11.5] failed to pull: Pulling repository docker.io/rancher/net)

Another similar message for a different component:
enter image description here

Docker version on Rancher server: 17.03.1-ce, build c6d412e
Docker version on Rancher agent: 1.12.6, build 78d1802

I created private registry which points to Artifactory. In the Kubernetes template, i specified the registry and that’s the only change i did in the template.

If i manually run the following commands, it works:

docker login docker.artifactory.abc.net -u svc-ranch-art_d
docker pull docker.artifactory.abc.net/rancher/net:v0.11.5

I can see in the Artifactory that the above version (0.11.5) gets cached. I am not sure that when Rancher tries starting services, why it goes to docker.io. Struggling since yesterday but couldn’t find anything.

Any help will really be appreciated.

-- Technext
docker
kubernetes
rancher

1 Answer

8/7/2017

Finally i was able to resolve it. There is a global setting registry.default which had to be changed from its default to the private registry that i created. After that, the environment had to be recreated. I did change the registry.default value but did not re-create the environment. That was the issue.

enter image description here

Ref: http://rancher.com/docs/rancher/v1.6/en/installing-rancher/installing-server/no-internet-access/#using-a-private-registry

-- Technext
Source: StackOverflow