Skip to content

Commit 024304a

Browse files
committed
auto negotiate docker version
1 parent 62cef58 commit 024304a

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

lib/connection/dockerurl.ex

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
defmodule Testcontainers.DockerUrl do
22
@moduledoc false
33

4-
@api_version "v1.41"
5-
64
@test_client Tesla.client([], Tesla.Adapter.Hackney)
75

86
def construct(docker_host) do
97
case URI.parse(docker_host) do
108
%URI{scheme: "unix", path: path} ->
11-
"http+unix://#{URI.encode_www_form(path)}/#{@api_version}"
9+
"http+unix://#{URI.encode_www_form(path)}"
1210

1311
%URI{scheme: "tcp"} = uri ->
14-
URI.to_string(%{uri | scheme: "http", path: "/#{@api_version}"})
12+
URI.to_string(%{uri | scheme: "http"})
1513

1614
%URI{scheme: _, authority: _} = uri ->
17-
URI.to_string(%{uri | path: "/#{@api_version}"})
15+
uri
1816
end
1917
end
2018

0 commit comments

Comments
 (0)