testcontainers-dotnet
testcontainers-dotnet copied to clipboard
Add pre-configured container for a single-node Elastic deployment
Is your feature request related to a problem? Please describe.
No problem, except we are in the process of creating our own custom Elasticsearch node configuration for testcontainers-dotnet, so I figured we might as well get it integrated upstream.
Describe the solution you'd like
Similarly to how testcontainers-java has an ElasticsearchContainer
, it would be great to have an ElasticsearchTestcontainer
in this repository. I would be happy to contribute this.
A few things I would like to have clarified before doing this:
Support for multiple major versions
The Java implementation has a single ElasticsearchContainer
intended for use across all versions of Elastic, including the OSS distribution. It already has logic tailored to version 8 (isAtLeastMajorVersion8
) and the OSS distribution (withPassword()
), which could get ugly in the long term. Would you prefer a single container and configuration object, with support for multiple versions, or separate ones for each major version?
Single vs. multi-node
The java version currently only supports single-node operation. I think we should limit the ElasticsearchTestcontainer
for this repository to single-node operation as well, and refer people to Docker Compose (once supported) if they need a multi-node cluster.
Describe alternatives you've considered
Keeping the configuration to ourselves in our private test helper projects. But where is the fun in that?
Additional context
I think it makes sense to do this as part of testcontainers#493 right away.
I think it makes sense to do this as part of #493 right away.
Yes, it does 😀.
Dunno if we should close this yet, but we have an MVP using the classic module implementation.
Just to know...any eta for 2.2.0? we need ElasticSearch integration and I have to decide if add custom configuration to our projects or wait for a new library release.
So thanks.
I would like to include the TLS feature in the next release. Most parts are done, but I think it will take another couple of days until we are ready for a release.
You can use the latest snapshot release in the meantime: 2.2.0-beta.2835065501
, this includes #523.
@HofmeisterAn i'm testing 2.2.0-beta.2835065501
version and i have problem to pull testimage:
Docker.DotNet.DockerImageNotFoundException : Docker API responded with status code=NotFound, response={"message":"No such image: testcontainers/ryuk:0.3.4"}
On command line docker pull testcontainers/ryuk:0.3.4
works like a charm.
Any advice?
Did you remove the image and try it again? I know some devs have temporary issues pulling images. If you still have problems, please create another issue. Do you use a private registry? How does your Docker config look? Any custom configurations? Does docker images --filter=reference='testcontainers/ryuk:0.3.4' --all
return something?
Strange issue.... removed images and ran again and again without success...what I found is that elasticsearch
image is pulled correctly using ElasticsearchTestcontainer
class but not testcontainers/ryuk:0.3.4
, If i run docker pull testcontainers/ryuk:0.3.4
everything is correct. I presume .net library uses the same approach for both images so really strange. @HofmeisterAn on your side everything run correctly? If the next days I will have the same problem I will create a new issue for sure!
Since we now have the new release that includes the Elasticsearch module, I will close this issue. While it does not currently contain all the great features of the Java implementation, we can create an issue and add them over time if anything is missing.