-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to use a custom entrypoint which is not a java command #579
Comments
Hi @rmannibucau , what kind of things are you doing in your startup script?
We generate the entrypoint to provide a easy no-setup way to run the Jib-built container, but this entrypoint can be changed at runtime. With Docker, you would run the image with For a Kubernetes Pod, it would look like:
|
I'm using this one https://github.com/apache/meecrowave/blob/trunk/meecrowave-maven-plugin/src/main/resources/bin/meecrowave.sh and want to keep the existing config the "API" of my image. I also want it to be built-in and not rely on a config (--entrypoint) I can't on some cloud provider :(. |
@rmannibucau Do you mind sharing which cloud provider does not support an entrypoint config when running a container? |
ECS had a lot of issues with that originally (there is still the disclaimer https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html). Also it is generally not desired when you have an ops team which doesn't know what it deploys. I think it is a quick win to support something else than java assuming the script is a portable sh script and it runs a java command at the end - think to tomcat use case where you want to reuse tomcat well known script. |
Ah okay. The considerations for allowing an arbitrary entrypoint for a Jib-built image is that:
|
If you take a custom FROM then any script can work so the plugin can just checks from is set or fail in such a case, no? Agree it can be another mojo (not plugin ;)) |
@rmannibucau do you mean using a custom base image in Jib? (That can be configured already) |
Yep, im happy to push a meecrowave image, just need to ensure jib pushes the bin and libs in right folders then (same would apply for tomcat) |
@rmannibucau it could be worth experimenting with trying to get meecrowave to fit into the jib model rather than the other way around. A lot of what's in the meecrowave.sh seems unnecessary in the context of a jib container. |
@rmannibucau Yep, if you use a custom base image, Jib will have all the files in that base image be in the same file paths in the final Jib image as in the base image. |
You can make it fit jib without any work (classpath deploymznt works with Cli main) but you dont want since ops know very well tomcat admin and meecrowave is a plain copy. It is the typical "practical for ops" vs "easy for dev" choice. Also being able to customize env in prebuilt scripts make it smooth compare to a long docker command and assuming you can do all the tuning in cloud providers (we are far from "image means portable" world in the cloud sadly). |
I'm running into an issue where I have multiple container configs that tune the JVM differently. I want to be able to just pass those settings into a single docker image, but CMD arguments get appended after the classname and get misinterpreted as the class to run. The previous build tool I was using got around this by making the entrypoint a shell script which could rearrange the arguments to satisfy the java command. |
Requesting more comments from @GoogleContainerTools/java-tools . @ccope You can set JVM flags using the |
@rmannibucau We have released version |
what about letting the base image defined entrypoint run. |
Ideally it will "fall through" to the base image defined entrypoint |
@ninpuabi you can use the |
I gather it is not possible to let my defined entrypoint complete and then the base image entrypoint start. I can't have my cake and eat it too. |
You could probably include a script in your build to do that (but you'd still have to explicitly know what your base image entry point is). |
Untested, but you might be able to use Jib's |
I dug up what the base image entrypoint is and called it in my entrypoint script. I want to give the a spin at some point |
Description of the issue:
Current jib is too opinionated on how to run a java command, even for spring boot apps it is limiting.
Allowing to run a script would be very beneficial for the whole ecosystem.
Expected behavior:
Entrypoint is configurable and can take any command.
It would be neat to synchronize src/main/jib/scripts folder into the image (same layer than the build classes?) to make it smooth and easy to maintain for teams.
The text was updated successfully, but these errors were encountered: