<p>I am trying to pass JVM args to Docker image of Spring boot app on Kubernetes. Specifically, I wanted to pass these three arguments:</p>
<pre><code>-Djavax.net.ssl.trustStore=/certs/truststore/cacerts
-Djavax.net.ssl.trustStorePassword=password
-Djavax.net.debug=ssl
</code></pre>
<p>I tried adding it to &quot;env&quot; section with name as &quot;JAVA_OPTS&quot;, &quot;JDK_JAVA_OPTIONS&quot; and &quot;JAVA_TOOL_OPTIONS&quot;, none of which seemed like they were working.</p>
<p>I also tried adding it under &quot;args&quot; section, that did not work either. At best I get no change in behaviour at all, at worst my pods won't start at all with this error:</p>
<blockquote>
<p>Error: failed to create containerd task: OCI runtime create failed:
container_linux.go:380: starting container process caused:
process_linux.go:545: container init caused: setenv: invalid argument:
unknown</p>
</blockquote>
<p>Entry point in Dockerfile is defined as such:</p>
<pre><code>ENTRYPOINT [&quot;java&quot;,&quot;-jar&quot;,&quot;/app/appname-exec.jar&quot;]
</code></pre>
<p>Any ideas?</p>

<p>To override the container's default <code>ENTRYPOINT</code> setting, I sometimes do the following:</p>
<pre class="lang-yaml prettyprint-override"><code>containers:
  - name: my-container
    image: mycontainer:latest
    command: [&quot;java&quot;]
    args: [&quot;-Djavax...&quot;, &quot;-Djavax...&quot;, &quot;-jar&quot;, &quot;myapp.jar&quot;]
</code></pre>
<p>You can define content in the manifest that you would describe in a Dockerfile. In <code>args</code> section, you can describe as many settings as you want.</p>
