title: Override ENTRYPOINT configuration in Micronaut Gradle Dockerfile
body: <p>I'm running a Micronaut application as a Docker container.</p>
  <p>At runtime in Kuberentes there will be a JAVA_OPTS environment variable with certaint values, e.g.: <code>-XX:MaxRAMPercentage=45.0</code></p>
  <p>When executing <code>./gradlew dockerBuild</code> I can see the following Docker layer:</p>
  <p><code>Step 7/7 : ENTRYPOINT [&quot;java&quot;, &quot;-jar&quot;, &quot;/home/app/application.jar&quot;]</code></p>
  <p>Following the <a href="https://micronaut-projects.github.io/micronaut-gradle-plugin/latest/#_docker_support" rel="nofollow noreferrer">documentation</a> I tried to add a reference to JAVA_OPTS:</p>
  <p>build.gradle.kts</p>
  <pre><code>    dockerfile {
          args(&quot;\$JAVA_OPTS&quot;)
      }
  </code></pre>
  <p>Docker build log:</p>
  <pre><code>Step 7/7 : ENTRYPOINT [&quot;java&quot;, &quot;$JAVA_OPTS&quot;, &quot;-jar&quot;, &quot;/home/app/application.jar&quot;]
  </code></pre>
  <p>The problem with this, is that the container wont's start, since $JAVA_OPTS won't be replaced by the env variable value. This happens because it is using the <a href="https://stackoverflow.com/a/37904830">exec form</a> of the ENTRYPOINT.</p>
  <p>Is there a way to override or tune the ENTRYPOINT so that env vars are evaluated?</p>