From 3d188653e83671458ed80be2163c1065c4838777 Mon Sep 17 00:00:00 2001 From: magnaibayar Date: Fri, 14 Nov 2025 22:14:50 +0800 Subject: [PATCH 1/3] feat: Docker api client version env variable --- src/DockerClientFactory.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DockerClientFactory.php b/src/DockerClientFactory.php index 0b6fbfb8..b18009a1 100644 --- a/src/DockerClientFactory.php +++ b/src/DockerClientFactory.php @@ -28,13 +28,14 @@ public static function create(array $config = [], ?PluginClientFactory $pluginCl $host = preg_match('/unix:\/\//', $config['remote_socket']) ? 'http://localhost' : $config['remote_socket']; $pluginClientFactory ??= new PluginClientFactory(); + $dockerClientVersion = getenv('DOCKER_API_VERSION') ?? 'v1.43'; return $pluginClientFactory->createClient( $socketClient, [ new ContentLengthPlugin(), new DecoderPlugin(), - new AddPathPlugin($uriFactory->createUri('/v1.43')), + new AddPathPlugin($uriFactory->createUri('/' . ltrim($dockerClientVersion))), new AddHostPlugin($uriFactory->createUri($host)), new HeaderDefaultsPlugin([ 'host' => parse_url($host, \PHP_URL_HOST), From 226115ded8e3b41ef5442533dd6fe96d2a0f0718 Mon Sep 17 00:00:00 2001 From: magnaibayar Date: Fri, 14 Nov 2025 23:13:33 +0800 Subject: [PATCH 2/3] fix: ternary --- src/DockerClientFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DockerClientFactory.php b/src/DockerClientFactory.php index b18009a1..fed72f19 100644 --- a/src/DockerClientFactory.php +++ b/src/DockerClientFactory.php @@ -28,7 +28,7 @@ public static function create(array $config = [], ?PluginClientFactory $pluginCl $host = preg_match('/unix:\/\//', $config['remote_socket']) ? 'http://localhost' : $config['remote_socket']; $pluginClientFactory ??= new PluginClientFactory(); - $dockerClientVersion = getenv('DOCKER_API_VERSION') ?? 'v1.43'; + $dockerClientVersion = getenv('DOCKER_API_VERSION') ? getenv('DOCKER_API_VERSION') : 'v1.43'; return $pluginClientFactory->createClient( $socketClient, From 4e8874baae2f99fda6bedd5a91e3de0028f986b6 Mon Sep 17 00:00:00 2001 From: Magnaibayar Ganzorig Date: Sat, 15 Nov 2025 12:51:02 +0800 Subject: [PATCH 3/3] fix: default version to v1.45 --- src/DockerClientFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DockerClientFactory.php b/src/DockerClientFactory.php index fed72f19..c9bf92d4 100644 --- a/src/DockerClientFactory.php +++ b/src/DockerClientFactory.php @@ -28,7 +28,7 @@ public static function create(array $config = [], ?PluginClientFactory $pluginCl $host = preg_match('/unix:\/\//', $config['remote_socket']) ? 'http://localhost' : $config['remote_socket']; $pluginClientFactory ??= new PluginClientFactory(); - $dockerClientVersion = getenv('DOCKER_API_VERSION') ? getenv('DOCKER_API_VERSION') : 'v1.43'; + $dockerClientVersion = getenv('DOCKER_API_VERSION') ? getenv('DOCKER_API_VERSION') : 'v1.45'; return $pluginClientFactory->createClient( $socketClient,