title: Docker-Compose Multiline Key
body: <p>How do I define a multiline key in docker-compose.yml?</p>
  
  <p>I tried diff solutions:</p>
  
  <pre><code>   environment:
        - PRIVATE_KEY= |-
          -----BEGIN RSA PRIVATE KEY-----
          line2
  
     environment:
        - PRIVATE_KEY= |
          -----BEGIN RSA PRIVATE KEY-----
          line2
  
     environment:
        - PRIVATE_KEY= !
          -----BEGIN RSA PRIVATE KEY-----
          line2
  
     environment:
        - PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nline2"
  
     environment:
        - PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n\nline2"
  </code></pre>
  
  <p>Resources:
  <a href="https://yaml-multiline.info/" rel="nofollow noreferrer">https://yaml-multiline.info/</a>
  <a href="https://gist.github.com/usmansaleem/bb47064f406c105fdfa69716544b7b8e" rel="nofollow noreferrer">https://gist.github.com/usmansaleem/bb47064f406c105fdfa69716544b7b8e</a></p>
  
  <p>But none of them formatted the private key in a proper way.</p>
  
  <p>Edit (Addition):</p>
  
  <pre><code>environment:
    - PRIVATE_KEY: |-
      -----BEGIN RSA PRIVATE KEY-----
      line2
  </code></pre>