title: How to output a multiline string in Dockerfile with a single command
body: <p>I want to output the following text in a Dockerfile:  </p>
  
  <pre><code>  *****first row *****  
    *****second row *****    
  </code></pre>
  
  <p>One way is to do it like that:  </p>
  
  <pre><code>cat &gt; Dockerfile &lt;&lt;EOF
  FROM alpine:latest
  RUN echo '  *****first row *****  ' &gt;&gt; /home/myfile
  RUN echo '  *****second row *****  ' &gt;&gt; /home/myfile
  ENTRYPOINT cat /home/myfile; sh;
  WORKDIR /home
  EOF  
  </code></pre>
  
  <p>But if I have 100 lines it takes time because it runs each command separately and make it as a layer.  </p>
  
  <p>Other way is like that:  </p>
  
  <pre><code>FROM alpine:latest
  RUN printf '  *****first row *****  \n  *****second row *****  \n' &gt;&gt; /home/myfile
  ENTRYPOINT cat /home/myfile; sh;
  WORKDIR /home
  </code></pre>
  
  <p>but I don't like it because it make it less readable, especially when you have 100 lines.  </p>
  
  <p>I wonder is there a way to do something like that:  </p>
  
  <pre><code>FROM alpine:latest
  RUN echo '  *****first row *****  
              *****second row *****  ' &gt;&gt; /home/myfile
  ENTRYPOINT cat /home/myfile; sh;
  WORKDIR /home
  </code></pre>
  
  <p>Or is there a way to use the <code>ARG</code> command to do it ?  </p>