From e336783dfd733a274e0eb24959c5dcf6f152c281 Mon Sep 17 00:00:00 2001 From: Schnitzel Date: Wed, 10 Jan 2018 12:58:11 -0600 Subject: [PATCH] better xdebug connection for linux --- images/php/fpm/entrypoints/60-php-xdebug.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/php/fpm/entrypoints/60-php-xdebug.sh b/images/php/fpm/entrypoints/60-php-xdebug.sh index ea34b44a65..36e38276cb 100755 --- a/images/php/fpm/entrypoints/60-php-xdebug.sh +++ b/images/php/fpm/entrypoints/60-php-xdebug.sh @@ -20,8 +20,8 @@ get_dockerhost() { return fi - # Fallback to localhost - echo "localhost" + # Fallback to default gateway (should work on Linux) see https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach + echo $(route -n | awk '/UG[ \t]/{print $2}') return }