1
0
Fork 0

Fix docker being seen as WSL when run inside WSL, fixes #10094

pull/10115/head
Jordi Boggiano 2021-09-13 21:11:55 +02:00
parent 4bcd860b65
commit 6179f33c74
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 1 deletions

View File

@ -108,7 +108,12 @@ class Platform
return self::$isWindowsSubsystemForLinux = false; return self::$isWindowsSubsystemForLinux = false;
} }
if (!ini_get('open_basedir') && is_readable('/proc/version') && false !== stripos(Silencer::call('file_get_contents', '/proc/version'), 'microsoft')) { if (
!ini_get('open_basedir')
&& is_readable('/proc/version')
&& false !== stripos(Silencer::call('file_get_contents', '/proc/version'), 'microsoft')
&& !file_exists('/.dockerenv') // docker running inside WSL should not be seen as WSL
) {
return self::$isWindowsSubsystemForLinux = true; return self::$isWindowsSubsystemForLinux = true;
} }
} }