Can I pull an image without Internet when the image exists in docker registry-mirror?
I create a registry mirror. Can I pull an image without Internet? I have created a mirror using this command:
docker run -d -p 5555:5000 -e STORAGE_PATH=/mirror -e STANDALONE=false -e MIRROR_SOURCE=https://registry-1.docker.io -e MIRROR_SOURCE_INDEX=https://index.docker.io -v /Users/v11/Documents/docker-mirror:/mirror --restart=always --name mirror registry
When I pull an image like hello-world:
docker pull image
I can find the image in local path what I set “/Users/v11/Documents/docker-mirror”. Does it mean I succeed in creating mirror? But, I closed the Internet, and delete the hello-world:
docker rmi hello-world
and pull again, but it failed. I want to know whether I must use mirror with Internet? if not, what is wrong with me?
By the way, I have started docker daemon with this ENV:
docker --insecure-registry 192.168.59.103:5555 --registry-mirror=http://192.168.59.103:5555 -d &
and 192.168.59.103 is my boot2docker ip.
One Solution collect form web for “Can I pull an image without Internet when the image exists in docker registry-mirror?”
In your configuration you specified a non-standalone setup using a
MIRROR_SOURCE_INDEX. So whenever you want to search for an image that index is queried. The other
MIRROR_SOURCE gets queried for the image itself.
You might be able to retrieve an image offline with a
pull request (that has already been pulled before while you were online). But you are not able to issue
docker search commands when the index is not available.
If you want to be completely independent from the public docker registry then you would need to setup your own private registry.