allow to specify the DOCKER_API_VERSION

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L. 2025-11-14 11:52:45 +01:00
parent 7560694535
commit 143cf5157c
5 changed files with 39 additions and 10 deletions

View file

@ -26,7 +26,13 @@ readonly class DockerActionManager {
}
private function BuildApiUrl(string $url): string {
return sprintf('http://127.0.0.1/%s/%s', self::API_VERSION, $url);
$apiVersion = getenv('DOCKER_API_VERSION');
if ($apiVersion === false || empty($apiVersion)) {
$apiVersion = self::API_VERSION;
} else {
$apiVersion = 'v'. $apiVersion;
}
return sprintf('http://127.0.0.1/%s/%s', $apiVersion, $url);
}
private function BuildImageName(Container $container): string {