Reputation: 757
I am using testcontainers
for the integration test where I create a container.
But its failing with following error:
Step failed
org.testcontainers.containers.ContainerLaunchException: Container startup failed
.....
Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=<my-docker-image>:latest, imagePullPolicy=DefaultPullPolicy())
at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1282)
at org.testcontainers.containers.GenericContainer.logger(GenericContainer.java:616)
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:321)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:312)
....
By looking at the error it looks like it is not able to find the docker image. But, I do have the image in local, I checked by comparing character by character.
I debugged it and at this line, I check the image has all the right value but for some reason its throwing an exception instead of returning the right value.
Any idea how can this be fixed?
Versions: testcontainers : 1.15.0-rc2 Docker version : 3.1.0, Engine: 20.10.2
Adding debug log(see how this.image.getImage()
name gets the name but other two fails):
Upvotes: 1
Views: 5455
Reputation: 757
.testcontainer.properties
in my $HOME
directory fixed the issue for me.
This file is used to override properties but I am still not sure how that fixes the issue.
I see in my .gitlab.yml
that what we do and just imitated that in my local, that solved the issue.
Upvotes: 1