title: Dockerfile if else condition with external arguments
body: <p>I have dockerfile</p>
  
  <pre><code>FROM centos:7
  ENV foo=42
  </code></pre>
  
  <p>then I build it </p>
  
  <pre><code>docker build -t my_docker .
  </code></pre>
  
  <p>and run it.</p>
  
  <pre><code>docker run -it -d  my_docker
  </code></pre>
  
  <p>Is it possible to pass arguments from command line and use it with if else in Dockerfile? I mean something like</p>
  
  <pre><code>FROM centos:7
  if (my_arg==42)
       {ENV=TRUE}
  else:
       {ENV=FALSE}
  </code></pre>
  
  <p>and build with this argument.</p>
  
  <pre><code> docker build -t my_docker . --my_arg=42
  </code></pre>