-
Please 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:
Ends up in exception:
Is there a way to turn off this type of validation? Version: 1.16.3 |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
Did you try the code as provided by the exception message? DockerImageName myImage = DockerImageName.parse("localhost/testcontainers/shreetkrpuzjpwzg")
.asCompatibleSubstituteFor("docker.elastic.co/elasticsearch/elasticsearch"); This exception happens when you start the Elasticsearch container, it has nothing to do with pulling through a proxy. |
Beta Was this translation helpful? Give feedback.
-
I did that for another case but I cannot wrestle the API to use DockerImageName instances in this case. The builder.from() method only takes a String. |
Beta Was this translation helpful? Give feedback.
-
And note that 'localhost/testcontainers/shreetkrpuzjpwzg' is not a name from our code but that seems to be auto generated by something inside TestContainers. ELASTICSEARCH_IMAGE is in our case set to "in-house-proxy/elasticsearch/elasticsearch:6.8.8". |
Beta Was this translation helpful? Give feedback.
-
Can you try something along the lines of: DockerImageName myImage = DockerImageName.parse(customImage.get())
.asCompatibleSubstituteFor("docker.elastic.co/elasticsearch/elasticsearch"); |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
.get() is the method |
Beta Was this translation helpful? Give feedback.
-
Great, this works! Thanks so much for the fast feedback. FYI - I am asking around internally if our company can become sponsors for Testcontainers. No promises but I'll see what I can do. |
Beta Was this translation helpful? Give feedback.
-
Great we could solve it for your use case 🙂 Also, we really appreciate advocating for Testconainers in your organization and helping others adopt it for their integration testing needs. |
Beta Was this translation helpful? Give feedback.
Can you try something along the lines of: