testcontainers / testcontainers-dotnet

A library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.
https://dotnet.testcontainers.org
MIT License
3.81k stars 279 forks source link

[Bug]: Keycloak 25 healthcheck endpoint not configured properly when using custom keycloak docker image #1272

Closed vfrz closed 1 month ago

vfrz commented 1 month ago

Testcontainers version

3.10.0 (Keycloak test container)

Using the latest Testcontainers version?

Yes

Host OS

Linux

Host arch

x86

.NET version

8

Docker version

N/A

Docker info

N/A

What happened?

Since Keycloak version 25, the ready check is not working properly even with latest TestContainers.Keycloak nuget package (3.10.0) because we are using custom keycloak docker image with custom versioning. The new endpoint is configured based on the image version: https://github.com/testcontainers/testcontainers-dotnet/pull/1213 I don't have a perfect solution in mind, but maybe making an extension method on the builder would be the best solution?

Relevant log output

No response

Additional information

No response

HofmeisterAn commented 1 month ago

If your custom image does not follow the semantic versioning of the official image, you can either override the default wait strategy or use the generic builder to create your own container configuration from scratch. Modules are pre-configured and opinionated, so we cannot support all types of customizations.

vfrz commented 1 month ago

Alright, understandable. We did just that, we overrode the wait strategy.