Open CleanCut opened 8 years ago
Very bizarre. I see no reason why running an echo
piped to /dev/null
should magically make pulls from a private registry stop stalling. A better question is why they are stalling in the first place. What's your network setup like? Is there VPN, firewall, etc.?
Do you have a minimally reproducible example that I could try? e.g. a Compose file which runs a local private registry and allows for duping the issue.
It isn't the echo command. It's the docker-machine ssh
command that makes a difference. Each time you establish or quit the connection, we get signs of life. So the point of that loop is to keep establishing and tearing down the connection.
I'll try to make a portable & reproducible scenario tomorrow. In the meantime, here's some info:
Clients:
docker-machine create --driver virtualbox --engine-insecure-registry 10.0.0.0/8 --virtualbox-cpu-count -1 --virtualbox-memory 2048 --virtualbox-disk-size 30000 default
(Note that we also have linux clients, and they're not affected by the slowness, even though they're running the same pull commands)
Registry:
docker run -d -p 80:5000 --restart=always --name registry -v /root/docker_storage:/var/lib/registry registry:2
# docker version
Client:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Mon Feb 22 21:37:01 2016
OS/Arch: linux/amd64
Server:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Mon Feb 22 21:37:01 2016
OS/Arch: linux/amd64
The content of the images we push to the private registry doesn't matter. The slowness affects any pull command run against the registry after a little while has passed.
After much pain and agony with our OS X "El Capitan" machines stalling while pulling images from our private registry (v2, fully up-to-date registry container and host OS), I have developed the following magic command that will cause the pulls to work decently well.
Here is the magic command. You must run it in a separate terminal window until your pull command has succeeded.
eval $(docker-machine env default) ; while true; do docker-machine ssh default "echo hello > /dev/null" ; sleep .2 ; done
I've got over a dozen developers affected by this constantly. I have searched and searched, and can't find anyone else with the problem. If anyone could help me find a real fix, it would be most appreciated.
In the meantime, perhaps this magic command will help fellow-sufferers.