Don't show root warning for Podman containers (#11946)
parent
6778f1f79a
commit
ea28853305
|
@ -217,7 +217,11 @@ class Application extends BaseApplication
|
||||||
$needsSudoCheck = !Platform::isWindows()
|
$needsSudoCheck = !Platform::isWindows()
|
||||||
&& function_exists('exec')
|
&& function_exists('exec')
|
||||||
&& !Platform::getEnv('COMPOSER_ALLOW_SUPERUSER')
|
&& !Platform::getEnv('COMPOSER_ALLOW_SUPERUSER')
|
||||||
&& (ini_get('open_basedir') || !file_exists('/.dockerenv'));
|
&& (ini_get('open_basedir') || (
|
||||||
|
!file_exists('/.dockerenv')
|
||||||
|
&& !file_exists('/run/.containerenv')
|
||||||
|
&& !file_exists('/var/run/.containerenv')
|
||||||
|
));
|
||||||
$isNonAllowedRoot = false;
|
$isNonAllowedRoot = false;
|
||||||
|
|
||||||
// Clobber sudo credentials if COMPOSER_ALLOW_SUPERUSER is not set before loading plugins
|
// Clobber sudo credentials if COMPOSER_ALLOW_SUPERUSER is not set before loading plugins
|
||||||
|
|
|
@ -152,7 +152,9 @@ class Platform
|
||||||
!ini_get('open_basedir')
|
!ini_get('open_basedir')
|
||||||
&& is_readable('/proc/version')
|
&& is_readable('/proc/version')
|
||||||
&& false !== stripos((string)Silencer::call('file_get_contents', '/proc/version'), 'microsoft')
|
&& false !== stripos((string)Silencer::call('file_get_contents', '/proc/version'), 'microsoft')
|
||||||
&& !file_exists('/.dockerenv') // docker running inside WSL should not be seen as WSL
|
&& !file_exists('/.dockerenv') // Docker and Podman running inside WSL should not be seen as WSL
|
||||||
|
&& !file_exists('/run/.containerenv')
|
||||||
|
&& !file_exists('/var/run/.containerenv')
|
||||||
) {
|
) {
|
||||||
return self::$isWindowsSubsystemForLinux = true;
|
return self::$isWindowsSubsystemForLinux = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue