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

Xdebug on Linux needs a programmatic value for remote_host #2

Open
jtreminio opened this issue Apr 4, 2018 · 2 comments
Open

Xdebug on Linux needs a programmatic value for remote_host #2

jtreminio opened this issue Apr 4, 2018 · 2 comments

Comments

@jtreminio
Copy link
Owner

jtreminio commented Apr 4, 2018

Currently suggest using 192.18.0.1 to access host from within container.

This really only works when user does not have any other networks defined and is spinning up a Dashtainer project on a vanilla host. If any other networks defined that IP is no longer valid.

Using route | awk '/^default/ { print $2 }' we can find the gateway that can be used for Xdebug (and other services that must reach host!).

Windows and MacOS can use docker.for.mac.host.internal, docker.for.win.host.internal. Maybe create an entry in /etc/hosts for containers that need this?

apt-get install net-tools
&& echo $(route | awk '/^default/ { print $2 }') docker.for.linux.host.internal >> /etc/hosts
@ntzm
Copy link

ntzm commented Apr 4, 2018

As of docker 18.03 it's host.docker.internal for both windows and mac, there is an issue here for linux docker/for-linux#264

@jtreminio
Copy link
Owner Author

Thanks @ntzm - looks like writing to /etc/hosts is a no-go since that file is mounted and any changes are immediately discarded.

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

No branches or pull requests

2 participants