Confusion with custom container images and kc.sh error message #11001
akikoskinen
started this conversation in
Archive
Replies: 1 comment 1 reply
-
|
I figured that using a combination of
This way developers can pass in the appropriate command based on the use case. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Here's a short version of what I have done.
I created a custom container image, pretty much according to the documentation. In the documentation, on the last line of the Dockerfile it reads
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start"]. That's what I put in my custom image.Then I tried to use this custom image with Keycloak Testcontainer. It failed to start my custom Keycloak image. The error message was:
Keycloak Testcontainer manages to start the default image from quay.io just fine, so apparently there was something wrong with my custom image. After a long study I figured that Keycloak Testcontainer adds some command arguments with what it starts the container. Those include
startand--auto-buildamong others. As a result the command to execute in my custom image becomes something like/opt/keycloak/bin/kc.sh start start --auto-build.After that I tried what happens if I try to run the standalone distribution of Keycloak 17 with the command
kc.sh start start --auto-build. And lo and behold, there it is the most confusing error message:Unmatched argument at index 1: 'build'.I think there are a few places that could be improved:
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start"]) is not the same that is in the official image (which isENTRYPOINT ["/opt/keycloak/bin/kc.sh"]). As a result, the custom image can't be started with the same arguments as the official image. Alternatively the documentation could use the same entry point in the example as the official image uses, i.e. without thestartargument. That way the custom image could work as a drop-in replacement for the official image.kc.shscript, it should print a clear error that many commands were given and that's not allowed. The current behavior is most confusing, at least with thestart start --auto-buildarguments.Unmatched argument at index 1: 'build'is a pretty bad error message in any situation. "Unmatched"? When matching against what? Perhaps some whitelist somewhere? "At index 1"? This index refers to what? Some list somewhere? Is it a 0 or 1 based indexing scheme? Overall, very confusing.Beta Was this translation helpful? Give feedback.
All reactions