title: Use same variable multiple times in a Dockerfile
body: <p>I'm trying to use the same variable (<code>$MINERV</code>) multiple times in the following Dockerfile</p>
  <pre><code>FROM debian:stable
  
  ARG MINERV=5.5c
  
  RUN export DEBIAN_FRONTEND=noninteractive
  RUN apt-get update
  RUN apt-get upgrade -y
  RUN apt-get install -y curl
  RUN mkdir /home/docker
  RUN curl &quot;https://github.com/PhoenixMinerDevTeam/PhoenixMiner/releases/download/$MINERV/PhoenixMiner_$MINERV_Linux.tar.gz&quot; -L -o &quot;/home/docker/PhoenixMiner_$MINERV_Linux.tar.gz&quot;
  
  WORKDIR /home/docker
  
  CMD [&quot;ls&quot;]
  </code></pre>
  <p>The output for <code>docker build . -t test &amp;&amp; docker run test</code> is <code>PhoenixMiner_.tar.gz</code> when I'm expecting <code>PhoenixMiner_5.5c_linux.tar.gz</code></p>
  <p>I can confirm the <code>curl</code> is trying to grab <code>https://github.com/PhoenixMinerDevTeam/PhoenixMiner/releases/download/5.5c/PhoenixMiner_$MINERV_Linux.tar.gz</code> as well. I've also tried it with <code>ENV</code> instead of <code>ARG</code> to the same result.</p>
  <p>How can I use the same variable multiple times in a Dockerfile?</p>
  <p>Thanks!</p>