<p>I'm trying to add new variable to JAVA_OPTS</p>
<p>Wildfly command in Dockerfile:</p>
<pre><code>CMD cd /opt/wildfly/bin &amp;&amp; ./standalone.sh -b=&quot;0.0.0.0&quot;
</code></pre>
<p>Pod yaml file:</p>
<pre><code> env:
   - name: JAVA_OPTS
     value: -DattributeName=value
</code></pre>
<p>But the new attribute is not added to system properties and I see only default variables defined in standalone.conf:</p>
<pre><code>JAVA_OPTS:  -server -Xms6g -Xmx6g -XX:MetaspaceSize=1536M -XX:MaxMetaspaceSize=1536M -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n -Duser.language=en -Duser.region=US -Dfile.encoding=UTF-8 -Dclient.encoding.override=UTF-8 -Ddefault.client.encoding=UTF-8 -Dorg.apache.catalina.connector.URI_ENCODING=UTF-8 -Dorg.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING=true -Djboss.as.management.blocking.timeout=6000 -Didit.system.placeholder
</code></pre>
<p>Any idea how set JAVA_OPTS by k8s yaml file? Thanks!</p>

Mortova
<p>I extended the standard wildfly image by creating a <code>Dockerfile</code> containing:</p>
<pre><code>COPY standalone.conf /opt/wildfly/bin
</code></pre>
<p>I added placeholder in <code>standalone.conf</code> for JAVA_OPTS added by kubernetes environment variable</p>
<pre><code>JAVA_OPTS=&quot;$JAVA_OPTS $DYNAMIC_JAVA_OPTS&quot;
</code></pre>
<p>Inject the parameter by k8s yaml</p>
<pre><code>env:
   - name: DYNAMIC_JAVA_OPTS
   value: -DattributeName=value
</code></pre>
