testcontainers-dotnet: All Elasticsearch module tests fail
Describe the bug All Elasticsearch module tests fail on clean operating system.
To Reproduce Steps to reproduce the behavior:
- Install Docker desktop (Rancher desktop, Moby engine)
- Run Elasticsearch module tests
- All tests fail with following error message:
Docker.DotNet.DockerApiException : Docker API responded with status code=Conflict, response={"message":"Container 776f26413636a94482827057706c065e5d697951e882c6a84a0827979d6aea6a is not running"}
Expected behavior All tests should pass.
Screenshots

Desktop (please complete the following information):
- version: 2.1.0
- os: Windows 11 (WSL), Ubuntu Desktop 20.04 LTS
- docker: Docker dekstop, Rancher Desktop, Moby engine (Microsoft build)
Additional context Elasticsearch container does not want to start and fail. Container logs provide the following evidences:
-
As the last log message:
ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch. -
It refers to result of bootstrap check service:
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] -
Based on the following discussions there is several ways how to solve it:
- https://stackoverflow.com/questions/51445846/elasticsearch-max-virtual-memory-areas-vm-max-map-count-65530-is-too-low-inc
- https://www.elastic.co/guide/en/cloud-on-k8s/master/k8s-virtual-memory.html
- https://discuss.elastic.co/t/eck-elasticsearch-pod-not-starting-on-aks-max-virtual-memory-areas-vm-max-map-count-65530-is-too-low-increase-to-at-least-262144/305788
The last one contains information regarding disabling the bootstrap check for non production and for low memory clusters. I think this is the best approach to fix tests. I will try to provide a PR to fix this based on last option.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (9 by maintainers)
Commits related to this issue
- fix(#640): Elasticsearch tests run without system level setup — committed to vlaskal/dotnet-testcontainers by vlaskal 2 years ago
- feat(#640): Add WithResourceMapping — committed to testcontainers/testcontainers-dotnet by HofmeisterAn 2 years ago
- feat(#640): Add WithResourceMapping (#652) — committed to testcontainers/testcontainers-dotnet by HofmeisterAn 2 years ago
- fix(#640) Fixed locked file in CopyResourceMappingContainerTest — committed to vlaskal/dotnet-testcontainers by vlaskal 2 years ago
- fix(#640): CopyResourceMappingContainerTest IOException on Windows (cannot access same file stream in the same process) — committed to testcontainers/testcontainers-dotnet by vlaskal 2 years ago
I am not sure if we can “copy” files like Java does at the moment. If not it would be a good opportunity to add it, otherwise we can simply use the Java approach right away.