Merge pull request #7127 from nextcloud/enh/7096/specify-api-version

allow to specify the `DOCKER_API_VERSION`
This commit is contained in:
Simon L. 2025-11-20 10:39:37 +01:00 committed by GitHub
commit 790b3d668d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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 {