<p>I've built a Quarkus 2.7.1 console application using <a href="https://quarkus.io/guides/picocli" rel="nofollow noreferrer">picocli</a> that includes several subcommands. I'd like to be able to run this application within a Kubernetes cluster and decide its arguments at run-time. This is so that I can use the same container image to run the application in different modes within the cluster.</p>
<p>To get things started I added the <a href="https://quarkus.io/guides/container-image#jib" rel="nofollow noreferrer">JIB extension</a> and tried setting the arguments using a configuration value <code>quarkus.jib.jvm-arguments</code>. Unfortunately it seems like this configuration value is locked at build-time so I'm unable to update this at run-time.</p>
<p>Next I tried setting <code>quarkus.args</code> while using default settings for JIB. The configuration value documentation makes it sound general enough for the job but it doesn't seem to have an affect when the application is run in the container. Since most references to this configuration value in documentation are in the context of Dev Mode I'm wondering if this may be disabled outside of that.</p>
<p>How can I get this application running in a container image with its arguments decided at run-time?</p>

oaklandcorp-jkaiser
<p>You can set <code>quarkus.jib.jvm-entrypoint</code> to any container entrypoint command you want, including scripts. An example in the <a href="https://quarkus.io/guides/container-image#jvm-debugging" rel="nofollow noreferrer">doc</a> is <code>quarkus.jib.jvm-entrypoint=/deployments/run-java.sh</code>. You could make use of <code>$CLI_ARGUMENTS</code> in such a script. Even something like <code>quarkus.jib.jvm-entrypoint=/bin/sh,-c,'/deployments/run-java.sh $CLI_ARGUMENTS'</code> should work too, as long as you place the script <code>run-java.sh</code> at <code>/deployments</code> in the image. The possibility is limitless.</p>
<p>Also see this <a href="https://stackoverflow.com/q/69845401/1701388">SO answer</a> if there's an issue. (The OP in the link put a customer script at <code>src/main/jib/docker/run-java.sh</code> (<code>src/main/jib</code> is Jib's default &quot;extra files directory&quot;) so that Jib places the script in the image at <code>/docker/run-java.sh</code>.</p>
