Xdebug host is not discovered correctly
See original GitHub issueDescribe the bug
When XDEBUG_ENABLE: "true"
is specified, the xdebug. remote_host
is always set to 172.22.0.1
.
Running the command from https://github.com/amazeeio/lagoon/blob/master/images/php/fpm/entrypoints/60-php-xdebug.sh#L6 after container started returns correct results.
It looks like the timeout is too low to get this command running correctly during container starting.
To Reproduce Steps to reproduce the behavior on MacOS:
- Set
XDEBUG_ENABLE: "true"
indocker-compose.yml
. docker-compose up -d --build
- Create a page with
phpinfo()
and run it. - Check the value of
xdebug.remote_host
. It will be172.22.0.1
.
Expected behavior
The value of xdebug.remote_host
should be docker.for.mac.localhost
.
It is possible to override this by setting DOCKERHOST: "docker.for.mac.localhost"
in docker-compose.yml
, but this defeats the purpose of the auto-discovery mechanism in https://github.com/amazeeio/lagoon/blob/master/images/php/fpm/entrypoints/60-php-xdebug.sh.
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (12 by maintainers)
Top GitHub Comments
I’ve got a commit ready to support the changes @Schnitzel has raised.
Just wanted to note,
host.docker.internal
should be supported on linux soon too via https://github.com/moby/moby/pull/40007