title: Dockerfile capture output of a command
body: <p>I have the following line in my Dockerfile which is supposed to capture the display number of the host:</p>
  
  <pre><code>RUN      DISPLAY_NUMBER="$(echo $DISPLAY | cut -d. -f1 | cut -d: -f2)" &amp;&amp; echo $DISPLAY_NUMBER
  </code></pre>
  
  <p>When I tried to build the Dockerfile, the DISPLAY_NUMBER is empty. But however when I run the same command directly in the terminal I get the see the result. Is there anything that I'm doing wrong here?</p>