diff --git a/src/Composer/Util/Platform.php b/src/Composer/Util/Platform.php index 7adcf00a6..8f8ed2682 100644 --- a/src/Composer/Util/Platform.php +++ b/src/Composer/Util/Platform.php @@ -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; } }