I am using docker-registry to pull my own docker images, but I want to do so without the need to specify the host. meanning: instead of writing:
docker pull <host>:<port>/<dockerImage>
I want to write:
docker pull <dockerImage>
and first it will try to pull the docker from my private registry, before trying to pull it from the public docker registry.
Is it possible?
I tried to change the DOCKER_INDEX_URL
to [my_docker_registry_host]:[port]
, but it doesn't work.
In order to pull images from your private repository, you'll need to login to Docker. If no registry URI is specified, Docker will assume you intend to use or log out from Docker Hub. Triton comes with several images built-in. You can view the available list with triton images .
By default the registry container keep the data in /var/lib/registry within the container. You can bind mount a local directory on your host like the example did -v /mnt/registry:/var/lib/registry ; which in this case the data will be kept on your host at /mnt/registry.
You can modify 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 modify /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 a image,docker will pull it from your private registry first,and then docker hub if not found in your private registry.I am working on CentOS 7 Docker 1.12.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With