Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

"Connection refused" running docker-osx-dev with docker-machine #183

Open
rkuzsma opened this issue Apr 11, 2016 · 1 comment
Open

"Connection refused" running docker-osx-dev with docker-machine #183

rkuzsma opened this issue Apr 11, 2016 · 1 comment

Comments

@rkuzsma
Copy link

rkuzsma commented Apr 11, 2016

docker-osx-dev cannot connect to my docker-machine to be able to rsync files.

I'm on OSX 10.11.2, using docker-machine, not boot2docker.

Relevant output when running docker-osx-dev -l DEBUG

2016-04-10 20:38:30 [DEBUG] Starting sync paths: /Users/snipped/foo
2016-04-10 20:38:30 [DEBUG] rsync --archive --log-format 'Syncing %n: %i' --delete --omit-dir-times --inplace --whole-file -l --rsh="ssh -i /Users/snipped/.docker/machine/machines/default/id_rsa -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" /Users/snipped/foo docker@:/Users/snipped 2>&1 | grep -v "^Warning: Permanently added"
2016-04-10 20:38:30 [INFO] ssh: connect to host  port 22: Connection refused
2016-04-10 20:38:30 [INFO] rsync: connection unexpectedly closed (0 bytes received so far) [sender]
2016-04-10 20:38:30 [INFO] rsync error: error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]
2016-04-10 20:38:30 [INFO] Initial sync done
2016-04-10 20:38:30 [INFO] Watching: /Users/snipped/foo

This part of the rsync command looks like the IP address got truncated: docker@:/Users/snipped

My docker-machine inspect doesn't return an IPAddress. Could be related to docker-machine issue 1041

  1. not all drivers expose an IP Address, and to make matters worse, those that do sometimes spell IPAddress differently.
$ docker-machine inspect
{
    "ConfigVersion": 3,
    "Driver": {
        "IPAddress": "",
        "MachineName": "default",
        "SSHUser": "docker",
        ...

This command works, though:

$ docker-machine ip
192.168.99.100

Maybe tweaking this line of docker-osx-dev to use docker-machine ip will fix the issue:

DOCKER_HOST_IP=$(inspect_docker_machine "{{.Driver.IPAddress}}" || inspect_docker_machine "{{.Driver.Driver.IPAddress}}")
@brikis98
Copy link
Owner

Thanks for reporting. It looks like Docker driers are pretty inconsistent (and not backwards compatible) with what the configuration they expose. You can see we've already had to support two different ways of looking up the IP, and now, it's broken yet again! I'll check out your PR shortly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants