title: docker ENV vs RUN export
body: <p>Let's say I want combine these commands</p>
  
  <pre><code>RUN command_1
  ENV FOO bar
  RUN command_2
  </code></pre>
  
  <p>into</p>
  
  <pre><code>RUN command_1 &amp;&amp; export FOO=bar &amp;&amp; command_2
  </code></pre>
  
  <p>and was wondering if setting the variable with <code>RUN export</code> vs <code>ENV</code> was equivalent.</p>
  
  <p>In other words, is there a difference between these commands in a Dockerfile?</p>
  
  <pre><code>ENV FOO bar
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>RUN export FOO=bar
  </code></pre>