Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Docker for Mac beta to work by using port forwarding #9809

Merged
merged 1 commit into from
Jul 19, 2016

Conversation

csrwng
Copy link
Contributor

@csrwng csrwng commented Jul 12, 2016

Docker for Mac no longer allows direct access via TCP/IP to the VM that's running Docker.
Containers communicate with the outside world with forwarded ports that are opened on the host machine via unix pipes.
Port forwarding will not work on a container that uses the host's network stack (--net=host) which is what OpenShift uses.
This pull introduces a solution by using socat on the Mac to forward requests to 8443 to the origin container via 'docker exec'.
The option can be directly enabled by using the --forward-ports flag or will be used automatically when running on the Mac platform and no viable direct IP is found to the docker vm.

Fixes #9487

@csrwng
Copy link
Contributor Author

csrwng commented Jul 12, 2016

@bparees ptal

glog.V(4).Infof("Killing previous socat tunnel")
err = openshift.KillExistingSocat()
if err != nil {
glog.V(1).Infof("error: cannot kill socat: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we abort at this point instead of continuing/eating the error?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nm, this is shutdown so we wouldn't want to abort.

@csrwng csrwng force-pushed the cluster_up_dockerbeta branch 2 times, most recently from 5a3fd86 to 53e3fa7 Compare July 13, 2016 15:23
@csrwng
Copy link
Contributor Author

csrwng commented Jul 13, 2016

Added logging of the error if socat can't be killed. It sholuldn't be fatal though since the process could have been killed some other way.

@csrwng csrwng force-pushed the cluster_up_dockerbeta branch from 53e3fa7 to 1660986 Compare July 14, 2016 20:04
@csrwng
Copy link
Contributor Author

csrwng commented Jul 14, 2016

Now --forward-ports defaults to true if os == darwin and DOCKER_HOST is not set
Also, now ensuring that host directories exist before attempting to mount them.

@csrwng
Copy link
Contributor Author

csrwng commented Jul 15, 2016

The latest Docker for Windows is still not working with this branch (actually compile is broken)... working on a fix.

@csrwng csrwng force-pushed the cluster_up_dockerbeta branch from 1660986 to 2d58450 Compare July 16, 2016 04:09
@csrwng
Copy link
Contributor Author

csrwng commented Jul 16, 2016

Updated to allow windows to work

@csrwng
Copy link
Contributor Author

csrwng commented Jul 19, 2016

@bparees do you have any additional comments on this?

@bparees
Copy link
Contributor

bparees commented Jul 19, 2016

@csrwng nope, sorry, lgtm.

@csrwng
Copy link
Contributor Author

csrwng commented Jul 19, 2016

[merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented Jul 19, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6459/) (Image: devenv-rhel7_4623)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 2d58450

@openshift-bot openshift-bot merged commit affbf42 into openshift:master Jul 19, 2016
@csrwng csrwng deleted the cluster_up_dockerbeta branch December 21, 2016 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants