dasniko / testcontainers-keycloak

A Testcontainer implementation for Keycloak IAM & SSO.
Apache License 2.0
328 stars 51 forks source link

Container not starting when run on M1 chip #45

Closed sardort96 closed 2 years ago

sardort96 commented 2 years ago

I get the following error when running application tests: 11:30:56.050 [main] ERROR 🐳 [quay.io/keycloak/keycloak:15.0.2] - Could not start container org.testcontainers.containers.ContainerLaunchException: Timed out waiting for URL to be accessible (http://localhost:50853/auth should return HTTP 200)

Application was also not starting when using image jboss/keycloak. I was able to resolve this by using image wizzn/keycloak:14 locally.

Any workarounds available?

dasniko commented 2 years ago

Official Keycloak container is no arm64 architecture. Also, I'm afraid I cannot help here, as I don't have an M1 based machine here.

Running x86/amd64 containers on M1 has performance issues. But this is not related to this project, if there are no arm64 based images available.

Perhaps it helps when increasing the startup timeout value.

sardort96 commented 2 years ago

Official Keycloak container is no arm64 architecture. Also, I'm afraid I cannot help here, as I don't have an M1 based machine here.

Running x86/amd64 containers on M1 has performance issues. But this is not related to this project, if there are no arm64 based images available.

Perhaps it helps when increasing the startup timeout value.

Would it be possible to set image as a configuration parameter in the application?

dasniko commented 2 years ago

Yes, that's possible, see readme. But this means that the used image should (must) be configurable through same env vars used by original image. There's some internal configuration of the container on startup. If the custom image uses different envvar, this won't work.