title: How to include local libraries in build?
body: <p>I have a directory structure like this:</p>
  
  <pre><code>app/
  inc/
  www/
  </code></pre>
  
  <p>where <code>inc/</code> contains code that is common to <em>app</em> and <em>www</em>.  to create an image for app I do:</p>
  
  <pre><code>cd app
  docker build .
  </code></pre>
  
  <p>so the <em>context</em> for the build are the contents of <code>app/</code>.  of course, the code in <code>inc/</code> will be missing from the app and it breaks</p>
  
  <p>googling I've read suggestions that I should:</p>
  
  <pre><code>docker build -f app/Dockerfile .
  </code></pre>
  
  <p>which includes <code>inc/</code> (good) but also includes everything else (bad) e.g. www</p>
  
  <p>to solve the problem I would have to build a script that copies the contents of <code>inc/</code> into <code>app/</code>, performs the build and the deletes <code>app/inc/</code>.  but that's messy and, actually, I can't do it because I want <em>docker-compose</em> to do my builds.</p>
  
  <p>what is the recommended way to manage this?</p>