title: WORKDIR $HOME in Dockerfile does not seem to work
body: <p>I have a Dockerfile that contains two <code>WORKDIR</code> statements (amid other ones) like so:</p>
  
  <pre><code>RUN pwd # reports /root
  WORKDIR /tmp
  RUN wget ...
  RUN tar zxvf ...
  RUN cd ... &amp;&amp; ; ./configure &amp;&amp; make &amp;&amp; make install 
  RUN sed ...
  RUN sed ...
  RUN rm ...
  RUN rm -fr ...
  WORKDIR $HOME
  RUN pwd # reports /tmp (instead of /root)
  </code></pre>
  
  <p>I would expect <code>pwd</code> to be <code>/root</code> (i.e. <code>$HOME</code> for <code>root</code>) afterwards, but it remains at <code>/tmp</code>. Am I making an obvious mistake here? Is there a better way for restoring <code>pwd</code> to its "original" value.</p>