Skip to content

Using Jib

Jib is a library for building Docker images. You can use it as an alternative to Testcontainers default DockerfileBuilder.

GenericContainer<?> busybox = new GenericContainer<>(
    new JibImage(
        jibContainerBuilder -> {
            return jibContainerBuilder.setEntrypoint("echo", "Hello World");
    .withStartupCheckStrategy(new OneShotStartupCheckStrategy().withTimeout(Duration.ofSeconds(3)))


The Testcontainers library JAR will not automatically add a jib-core JAR to your project. Minimum version required is