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

Switch to newer detect-Docker-host-IP mechanism on Mac #224

Closed
itamarst opened this issue Jul 14, 2017 · 7 comments
Closed

Switch to newer detect-Docker-host-IP mechanism on Mac #224

itamarst opened this issue Jul 14, 2017 · 7 comments
Labels
feature New feature or enhancement request

Comments

@itamarst
Copy link

Currently on OS X we add a special IP alias to lo0 loopback interface, so that Docker containers can find the kubectl port-forward port when using --method container. Newer versions of Docker support a special DNS record docker.for.mac.localhost instead (this may obviate need for root, while we're at it.)

See https://docs.docker.com/docker-for-mac/networking/#use-cases-and-workarounds

We can't use this mechanism immediately since it's only present in absolute latest version of Docker, but eventually could switch.

@itamarst itamarst added the feature New feature or enhancement request label Jul 14, 2017
@ark3
Copy link
Contributor

ark3 commented Sep 27, 2017

Something like

docker run --rm -it --entrypoint "" $TELEPRESENCE_LOCAL_IMAGE nslookup docker.for.mac.localhost

should be pretty quick to query; the exit status is sufficient to know whether docker.for.mac.localhost is usable.

@ark3
Copy link
Contributor

ark3 commented Jan 5, 2018

The latest (edge) release makes this a bit more complicated. The release notes say:

DNS name docker.for.mac.host.internal shoud be used instead of docker.for.mac.localhost (still valid) for host resolution from containers, since since there is an RFC banning the use of subdomains of localhost (See https://tools.ietf.org/html/draft-west-let-localhost-be-localhost-06).

@ark3
Copy link
Contributor

ark3 commented Feb 27, 2018

Newest release notes say

DNS name host.docker.internal shoud be used for host resolution from containers. Older aliases (still valid) are deprecated in favor of this one.

@ark3
Copy link
Contributor

ark3 commented Apr 6, 2018

If they ever fix docker/for-linux#264, we could avoid the route -n nonsense entirely.

@ark3
Copy link
Contributor

ark3 commented Jun 21, 2018

Fixing this will move us closer to Windows support for the container method.

@duizendnegen
Copy link

Indications for possible solutions are https://dev.to/bufferings/access-host-from-a-docker-container-4099

@ark3
Copy link
Contributor

ark3 commented Dec 6, 2018

Telepresence 0.95 includes #726, and thus does not try to connect to the host from within the container. As such, this is no longer an issue. Closing.

@ark3 ark3 closed this as completed Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or enhancement request
Projects
None yet
Development

No branches or pull requests

3 participants