title: How to change a docker ARG value inside an if statement?
body: <p>In my Dockerfile on <em>Ubuntu 16.04</em> with <em>docker 17.12.1-ce</em> I use</p>
  
  <pre><code>ARG ver=latest
  ARG pkg=master
  </code></pre>
  
  <p>For building a docker container, I would like to call <code>docker build --build-arg ver=v1 .</code> in order to set a special package.</p>
  
  <p>The code-handling part in my Dockerfile is</p>
  
  <pre><code>RUN if[ "x$ver" = "xv1" ] ; then pkg=v1.2.3 ; fi
  RUN echo $pkg
  </code></pre>
  
  <p>Unfortunately, the <strong>ARG pkg</strong> variable is not updated and the echo statement always shows its initial value.</p>
  
  <p>What can I do, to update my build variable <strong>pkg</strong> inside an if statement??</p>