diff --git a/changelog.d/24026_fix_docker_logs_socket_path.fix.md b/changelog.d/24026_fix_docker_logs_socket_path.fix.md new file mode 100644 index 0000000000000..a6ef009511bd6 --- /dev/null +++ b/changelog.d/24026_fix_docker_logs_socket_path.fix.md @@ -0,0 +1,3 @@ +Fixed an issue in the `docker_logs` source where the `docker_host` option and `DOCKER_HOST` environment variable were ignored if they started with `unix://` or `npipe://`. In those cases the default location for the Docker socket was used + +authors: titaneric diff --git a/src/docker.rs b/src/docker.rs index 3780405056eea..cd13a4c4c54ce 100644 --- a/src/docker.rs +++ b/src/docker.rs @@ -77,7 +77,8 @@ pub fn docker(host: Option, tls: Option) -> crate::Resu .map_err(Into::into) } Some("unix") | Some("npipe") | None => { - Docker::connect_with_defaults().map_err(Into::into) + Docker::connect_with_socket(&host, DEFAULT_TIMEOUT, API_DEFAULT_VERSION) + .map_err(Into::into) } Some(scheme) => Err(format!("Unknown scheme: {scheme}").into()), }