ImageFromDockerfile.withDockerfileFromBuilder not possible to use with proxy
See original GitHub issuePlease provide a way to allow customization of an image when pulling it through a proxy. For example this snippet does not work if ELASTICSEARCH_IMAGE uses an in-house/local docker proxy:
ImageFromDockerfile customImage = new ImageFromDockerfile()
.withDockerfileFromBuilder(builder ->
builder
.from(ELASTICSEARCH_IMAGE)
.run("bin/elasticsearch-plugin", "install", "analysis-kuromoji")
.build());
Ends up in exception:
java.lang.IllegalStateException: Failed to verify that image 'localhost/testcontainers/shreetkrpuzjpwzg' is a compatible substitute for 'docker.elastic.co/elasticsearch/elasticsearch'. This generally means that you are trying to use an image that Testcontainers has not been designed to use. If this is deliberate, and if you are confident that the image is compatible, you should declare compatibility in code using the `asCompatibleSubstituteFor` method. For example:
DockerImageName myImage = DockerImageName.parse("localhost/testcontainers/shreetkrpuzjpwzg").asCompatibleSubstituteFor("docker.elastic.co/elasticsearch/elasticsearch");
and then use `myImage` instead.
Is there a way to turn off this type of validation?
Version: 1.16.3
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to use ImageFromDockerfile.withDockerfileFromBuilder ...
For example this snippet does not work if ELASTICSEARCH_IMAGE uses an in-house/local docker proxy: ImageFromDockerfile customImage = new ...
Read more >Creating images on-the-fly - Testcontainers for Java
Testcontainers will docker build a temporary container image, and will use it when creating the container. Dockerfile from String, file or classpath resource....
Read more >How to build Docker Images with Dockerfile behind ...
I had a problem when corporate network was not allowing to download and setup docker image so n/w gave http proxy information. while...
Read more >Dockerize your integration tests - DEV Community
Use testcontainers to dockerize your integration tests. ... Today, it's possible to use all the power of Docker and set up a connected...
Read more >ImageFromDockerfile.withDockerfileFromBuilder - Java
How to use. withDockerfileFromBuilder. method. in. org.testcontainers.images.builder.ImageFromDockerfile · Best Java code snippets using org.testcontainers.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
.get() is the method
Did you try the code as provided by the exception message?
This exception happens when you start the Elasticsearch container, it has nothing to do with pulling through a proxy.