title: Appending key to CATALINA_OPTS using kubernetes
body: <p>I have some CATALINA_OPTS properties (regarding database port, user and so on) set up in ConfigMap file. Then, this file is added to the docker image via Pod environment variable.
  One of the CATALINA_OPTS properties is database password, and it is required to move this from ConfigMap to the Secrets file.
  I can expose key from Secrets file through environment variable:</p>
  
  <pre><code>apiVersion: v1
  kind: Pod
    ...
    containers:
    - name: myContainer
      image: myImage
      env:
      - name: CATALINA_OPTS
        valueFrom:
         configMapKeyRef:
           name: catalina_opts
           key: CATALINA_OPTS
      - name: MY_ENV_PASSWORD
        valueFrom:
          secretKeyRef:
            name: db-pass
            key: my-pass
  </code></pre>
  
  <p>Thing is, i need to append this password to the CATALINA_OPTS. I tried to do it in Dockerfile:</p>
  
  <pre><code>  RUN export CATALINA_OPTS="$CATALINA_OPTS -Dmy.password=$MY_ENV_PASSWORD"
  </code></pre>
  
  <p>However, MY_ENV_PASSWORD is not appending to the existing CATALINA_OPTS. When I list my environment variables (i'm checking the log in Jenkins) i cannot see the password.
  Am I doing something wrong here? Is there any 'regular' way to do this?</p>