Pull Docker from my personal doc registry without specifying a host

I use docker-registry to pull my own docker images, but I want to do this without having to specify a host. meanning: instead of writing:

docker pull <host>:<port>/<dockerImage> 

I want to write:

 docker pull <dockerImage> 

and first he will try to get the docker out of my personal registry before trying to pull it out of the public docker registry.

Is it possible?

I tried changing DOCKER_INDEX_URL to [my_docker_registry_host]:[port] but it does not work.

+8
docker docker-registry
source share
2 answers

No, I think it is not yet supported (1.1.2 as a record). I guess the main reasons

The local private registry is not a mirror of the general registry, so the logical one is not that if it cannot be found locally, then it goes on public display. They are completely different.

Therefore, if we set up our own docker repository, but keep the same name, it will be corrupted.

When you run docker images and you see ubuntu , how do you know that this is from your local private registry or public.

UPDATE: add one example example

Also, if we have a Dockerfile , put tomcatit as the base

tomcat7
 FROM tomcat7 

How do you know that this assembly is happening?

If we want to have a strict process or control over the mapping between a private repo and a public repo, this will be difficult.

Technically it’s possible, but get less. This frees the power of the docker (community)

This is a similar case for another package system that requires a unique name for the package.

+1
source share

You can change or add your /etc/sysconfig/docker

 ADD_REGISTRY='--add-registry 192.168.0.169:5000' INSECURE_REGISTRY='--insecure-registry 192.168.0.169:5000' 

then change /etc/systemd/system/docker.service or /usr/lib/systemd/system/docker.service

 ExecStart=/usr/bin/dockerd --registry-mirror=http://192.168.0.169:5000 

when you pull out the image, the docker will first pull it out of your personal registry, and then the docker hub if it is not found in your personal registry. I am working on CentOS 7 Docker 1.12.

+1
source share

All Articles