Skip to content

How to Specify Private Registries? #5052

@GiovanniCampaner

Description

@GiovanniCampaner

Coming from: #1689

I'm using Maven with JUnit 5, trying to setup a container like this:

@QuarkusTest
@Testcontainers
@Tag("integration")
public class MyServiceIntegrationTest {

    private static final DockerImageName image = DockerImageName.parse("my-custom-repository/database/mariadb:latest")
            .asCompatibleSubstituteFor("mariadb");

    @Container
    private final MariaDBContainer<?> topLevelContainer = new MariaDBContainer<>(image)
            .withExposedPorts(3306);

    ...
}

But when launching with mvn integration-test I'm getting:

com.github.dockerjava.api.exception.InternalServerErrorException: 
Status 500: {"message":"Get https://registry-1.docker.io/v2/: Proxy Authentication Required"}

I can't use public repositories, how can I specify the image to be pulled from my-custom-repository and not registry-1.docker.io ?

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