title: When using COPY with more than one source file, the destination must be a directory and end with a /
body: <p>I decided to use the <a href="https://docs.docker.com/engine/reference/builder/#copy" rel="noreferrer">multiple source form of COPY</a> to save an intermediate command but when I run it the following error pops up:</p>
  
  <pre><code>Step 17/22 : COPY --chown=$APP_USER:$APP_USER Gemfile Gemfile.lock $APP_PATH
  When using COPY with more than one source file, the destination must be a directory and end with a /
  </code></pre>
  
  <p>In the Dockerfile I have this:</p>
  
  <pre><code>ARG APP_PATH='/usr/share/app/'
  
  ONBUILD COPY --chown=$APP_USER:$APP_USER Gemfile Gemfile.lock $APP_PATH
  </code></pre>
  
  <hr>
  
  <h3>Edit</h3>
  
  <p>Just to be clear, this happens with <code>ONBUILD</code> present and without, it just so happened I pasted in the <code>ONBUILD</code> example</p>
  
  <hr>
  
  <p>I've tried with and without the single quotes. The arg has a trailing slash and is a directory so why is the build not honouring it?</p>
  
  <p>I'd like to make this Dockerfile into a template using <code>ONBUILD</code> so it'd be good if I can make sure the <code>APP_PATH</code> arg is populated with a default that will work.</p>
  
  <p>Any help or insight will be much appreciated.</p>