Class DockerImage


  • public final class DockerImage
    extends Object
    A utility class with methods to generate a DockerImageName for Testcontainers.

    Testcontainers might not work if the image required is available in multiple different registries (for example when using podman instead of docker). These methods make sure to pick a registry as default.

    • Constructor Detail

      • DockerImage

        public DockerImage()
    • Method Detail

      • fromDockerfile

        public static org.testcontainers.utility.DockerImageName fromDockerfile​(String databaseName)
        Extract the image name and version from the first FROM instruction in the Dockerfile. Note that everything else is ignored.
      • imageName

        public static org.testcontainers.utility.DockerImageName imageName​(String registry,
                                                                           String image,
                                                                           String version)