1
0
Fork 0

feat: Detect containerd runtime and allow root execution (#12299)

Composer now permits running as root when the container runtime is containerd,
aligning with existing behavior for Docker and Podman.
main
Petar Obradović 2025-02-19 14:54:03 +01:00 committed by GitHub
parent bc4bc7340f
commit 0e7d519958
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -217,7 +217,11 @@ class Platform
} catch (\Throwable $e) {
break;
}
if (is_string($data) && str_contains($data, '/var/lib/docker/')) {
if (!is_string($data)) {
continue;
}
// detect default mount points created by Docker/containerd
if (str_contains($data, '/var/lib/docker/') || str_contains($data, '/io.containerd.snapshotter')) {
return self::$isDocker = true;
}
}