title: Setting relative paths in Dockerfile when building with ansible
body: <p>I am trying to build some docker files using ansible, but it is not clear what is used as the build directory.</p>
  <p>directory structure</p>
  <pre class="lang-none prettyprint-override"><code>.
  ├── build_images.yml
  └── deploy
      ├── app_files
      │   └── requirements.txt
      └── dockerfiles
          └── app
              └── Dockerfile
  </code></pre>
  <p>I am running the <code>build_images.yml</code> playbook as follows (it picks up the correct path)</p>
  <p>The <code>build_images.yml</code> file</p>
  <pre class="lang-yaml prettyprint-override"><code>---                                                                                                                                                                                                                                       
  - hosts: localhost
    connection: local
    
    tasks:
      - name: Build container
         docker_image:
         name: app
         path: deploy/dockerfiles/app
         pull: no
         state: build
  </code></pre>
  <p>However, my Dockerfile contains</p>
  <pre><code>FROM base_image:latest
  
  COPY ./deploy/app_files/requirements.txt requirements.txt
  </code></pre>
  <p>I have tried a few variations of the directory, but it keeps coming back with:</p>
  <blockquote>
  <p>no such file or directory</p>
  </blockquote>
  <p>What is the appropriate base docker build directory to use for relative paths in the Dockerfile?</p>