title: Dockerfile: Output of RUN instruction into a Variable
body: <p>I am writing a dockerfile and want to put the output of the "ls" command into a variable as shown below:</p>
  
  <pre><code>$file = ls /tmp/dir
  </code></pre>
  
  <p>Here, "dir" only has one file inside it.</p>
  
  <p>The following RUN instruction within a dockerfile is not working</p>
  
  <pre><code>RUN $file = ls /tmp/dir
  </code></pre>