docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.96k forks source link

Magic command to get docker-machine to pull from (private) registries on OS X El Capitan with docker-machine 1.10.3 #3244

Open CleanCut opened 8 years ago

CleanCut commented 8 years ago

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.

nathanleclaire commented 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.

CleanCut commented 8 years ago

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:

(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 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.