title: Using Dockerfile ARG within an ADD statement
body: <p>I am trying to create a dockerfile that adds files from build directory to the working directory.</p>
  
  <p>The build directory can vary and thus needs to be specified by an argument:</p>
  
  <pre><code>ARG BUILD_SOURCE
  
  FROM node:8.11.4
  
  WORKDIR /usr/local/app
  
  ADD "$BUILD_SOURCE" .
  </code></pre>
  
  <p>I ran this with <code>docker build BUILD_SOURCE=bin/bundle .</code>.</p>
  
  <p>Somehow the ARG is not substituted so that the whole current directory is added to the image.</p>
  
  <p>When I hardcode the build source it works fine.</p>
  
  <p>I have tried using <code>ENV</code> instead, copying the arg into the the env like this:</p>
  
  <pre><code>ENV BUILD_SOURCE $BUILD_SOURCE
  ADD "${BUILD_SOURCE}" .
  </code></pre>
  
  <p>That didn't work either.</p>
  
  <p>In the official docker documentation I cannot find this behaviour being mentioned.</p>
  
  <p>Does anybody why this is happening and what possible workaround would be?</p>