Skip to content

Commit

Permalink
use fixed version of docker-engine-api
Browse files Browse the repository at this point in the history
  • Loading branch information
jarlah committed Oct 11, 2023
1 parent cd408b3 commit 5ab9dc2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
22 changes: 2 additions & 20 deletions lib/testcontainers_elixir.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,10 @@ defmodule TestcontainersElixir do

def hello do
DockerEngineAPI.Connection.new(
base_url: base_url()
base_url: "http+unix://%2Fvar%2Frun%2Fdocker.sock/v1.43",
adapter: Tesla.Adapter.Hackney
)
|> DockerEngineAPI.Api.Image.image_list()
end

@socket_path "unix:///var/run/docker.sock"
@default_version "v1.43"

defp base_url() do
host = Application.get_env(:docker, :host) || System.get_env("DOCKER_HOST", @socket_path)
version =
case Application.get_env(:docker, :version) do
nil -> @default_version
version -> version
end


"#{normalize_host(host)}/#{version}"
|> String.trim_trailing("/")
end

defp normalize_host("tcp://" <> host), do: "http://" <> host
defp normalize_host("unix://" <> host), do: "http+unix://" <> URI.encode_www_form(host)

end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ defmodule TestcontainersElixir.MixProject do
defp deps do
[
{:ex_license, "~> 0.1.0"},
{:docker_engine_api, git: "https://github.com/jarlah/docker-engine-api.git", tag: "1.43.0-hackney"}
{:docker_engine_api, git: "https://github.com/jarlah/docker-engine-api-elixir.git", tag: "1.43.0-hackney"}
]
end

Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"},
"docker": {:git, "https://github.com/hexedpackets/docker-elixir.git", "b4f8b929691ce2bf9f11743def49009de460431b", [tag: "0.4.0"]},
"docker_api": {:git, "https://github.com/hexedpackets/docker-elixir.git", "b4f8b929691ce2bf9f11743def49009de460431b", [tag: "0.4.0"]},
"docker_engine_api": {:git, "https://github.com/jarlah/docker-engine-api.git", "12247693d92eaa48d4470648508762ff98bf9680", [tag: "1.43.0-hackney"]},
"docker_engine_api": {:git, "https://github.com/jarlah/docker-engine-api-elixir.git", "4a8672e0ea1d9534d9796c915a5f4f47af29d6cf", [tag: "1.43.0-hackney"]},
"ex_license": {:hex, :ex_license, "0.1.1", "bbdaba704f861894da3ae80e4399984379f19de1cca4ecf7d799616c832b8821", [:mix], [], "hexpm", "dd95aaaba0c9c6f0e9be2db3e9fac0bf69784557e04f700f94e90629f5e24e1d"},
"gleam_fetch": {:hex, :gleam_fetch, "0.2.1", "ae5b960e62858354e1f075d6c857730648218b18ef1f13b5dc93f15e109767ca", [:gleam], [{:gleam_http, "~> 3.1", [hex: :gleam_http, repo: "hexpm", optional: false]}, {:gleam_javascript, "~> 0.3", [hex: :gleam_javascript, repo: "hexpm", optional: false]}, {:gleam_stdlib, "~> 0.31", [hex: :gleam_stdlib, repo: "hexpm", optional: false]}], "hexpm", "f64e93c754d948b2d37abc4add5482fe0faed4b99c79e66012dde96bedc40544"},
"gleam_hackney": {:hex, :gleam_hackney, "1.1.0", "f6b1e413490b0214f0f1c3f2a8d720ee2149329e18a632d91c5657bbe3aad964", [:gleam], [{:gleam_http, "~> 3.0", [hex: :gleam_http, repo: "hexpm", optional: false]}, {:gleam_stdlib, "~> 0.18", [hex: :gleam_stdlib, repo: "hexpm", optional: false]}, {:hackney, "~> 1.18", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "ca69ad9061c4a8775a7bd445de33ecefd87379af8e5b028f3dd0216beca5dd0b"},
Expand Down

0 comments on commit 5ab9dc2

Please sign in to comment.