title: docker COPY with file globbing
body: <p>Inside the dockerfile, I want to specify a copy operation for files which are defined by globbing and I want it to be copied with the path as well. So, something like this:</p>
  
  <pre><code>COPY ./src/**/project.json /app/**/
  </code></pre>
  
  <p>Considering I have the following structure:</p>
  
  <pre><code>./src/bar/project.json
  ./src/foo/project.json
  </code></pre>
  
  <p>The destination should look like this:</p>
  
  <pre><code>/app/bar/project.json
  /app/foo/project.json
  </code></pre>
  
  <p>but apparently, this doesn't work and I really don't want to specify all of the COPY operations separately if I have a chance. Any idea how to do this?</p>
  
  <blockquote>
    <p>Note that I cannot basically ignore other files through <code>.dockerignore</code> <a href="https://stackoverflow.com/a/35671942/463785">as suggested</a> as I am going to copy the other files from the same folder after ruining a package install operation. So, the dockerfile is similar to this:</p>
  
  <pre><code>FROM microsoft/aspnet:1.0.0-rc1-update1
  
  COPY ./src/**/project.json /app/**/
  WORKDIR /app/ModernShopping.Auth
  RUN ["dnu", "restore"]
  ADD ./src /app
  
  EXPOSE 44300
  ENTRYPOINT ["dnx", "web"]
  </code></pre>
  </blockquote>