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

main
Jordi Boggiano 3 years ago
parent 4bcd860b65
commit 6179f33c74
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -108,7 +108,12 @@ class Platform
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;
}
}

Loading…
Cancel
Save