title: Docker COPY and keep directory
body: <p>Need to copy multiple directories in my Dockerfile. Currently, I'm doing:</p>
  
  <pre><code>COPY dir1 /opt/dir1
  COPY dir2 /opt/dir2
  COPY dir3 /opt/dir3
  </code></pre>
  
  <p>I would prefer to consolidate those into one single statement, specifying all the sources in one go. However, this way the <strong>contents</strong> are copied, and I lose the <code>dir1</code>, <code>dir2</code>, <code>dir3</code> structure:</p>
  
  <pre><code>COPY dir1 dir2 dir3 /opt/
  </code></pre>
  
  <p>Same in this case:</p>
  
  <pre><code>COPY dir1/ dir2/ dir3/ /opt/
  </code></pre>
  
  <p>Is there some way to achieve this with one line?</p>