Skip to content

NPE when no image tag is specified #676

@aruizca

Description

@aruizca

This is my current GenericContainer declaration:

    @Shared
    GenericContainer container = new GenericContainer("my-local-image")
            .withEnv("CONFLUENCE_VERSION", "6.8.2")
            .withExposedPorts(1990)
            .waitingFor(Wait.forListeningPort())

and I get the following error:

java.lang.NullPointerException
	at org.testcontainers.utility.DockerImageName.toString(DockerImageName.java:97)
	at java.lang.String.valueOf(String.java:2994)
	at java.lang.StringBuilder.append(StringBuilder.java:131)
	at org.testcontainers.images.RemoteDockerImage.toString(RemoteDockerImage.java:25)
	at java.lang.String.valueOf(String.java:2994)
	at java.lang.StringBuilder.append(StringBuilder.java:131)
	at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:841)
	at org.testcontainers.containers.GenericContainer.setDockerImageName(GenericContainer.java:829)
	at org.testcontainers.containers.GenericContainer.<init>(GenericContainer.java:185)
	at com.comalatech.confluence.test.poc.PocSpec.$spock_initializeSharedFields(PocSpec.groovy:25)

FYI, the image exists locally and I am able to use it to launch containers using Docker for Mac

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions