Skip to content

Getting an HTTP 407 error, testcontainers unable to auth to docker? #182

@akosasante

Description

@akosasante

Using testcontainers-elixir 1.12.0

My test_helper.exs:

Testcontainers.start_link()
ExUnit.start()

Sample test file:

defmodule ContainersTest do
  use ExUnit.Case, async: true

  def setup do
    config = %Testcontainers.Container{image: "redis:5.0.3-alpine"}
    {:ok, container} = Testcontainers.start_container(config)

    {:ok, container: container}
  end

  test "container is running", %{container: container} do
    IO.inspect(container, label: "Container")
    :ok
  end
end

The test exits with the failure ** (EXIT from #PID<0.98.0>) {:error, {:http_error, 407}}

I dug into the source code a bit and this seems to be returned when I run the code:

"Pull failed due to an unauthenticated request. Registry Access Management is enabled, which requires pulls to be authenticated. Please run `docker login`, or contact your administrators if this is unexpected.\n"

I have run docker login first but it doesn't change the outcome. Please advise what else I can do to help debug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions