Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/DockerClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') ? getenv('DOCKER_API_VERSION') : 'v1.45';

return $pluginClientFactory->createClient(
$socketClient,
[
new ContentLengthPlugin(),
new DecoderPlugin(),
new AddPathPlugin($uriFactory->createUri('/v1.45')),
new AddPathPlugin($uriFactory->createUri('/' . ltrim($dockerClientVersion))),
new AddHostPlugin($uriFactory->createUri($host)),
new HeaderDefaultsPlugin([
'host' => parse_url($host, \PHP_URL_HOST),
Expand Down