title: Docker: sync files created by dockerfile with host through volume
body: <p>When i use docker-compose with volumes to sync my files from host to container i cant see any new files created in the dockerfile</p>
  
  <p>my docker-compose.yml:</p>
  
  <pre><code>version: "3"
  
  services:
    web:
      image: nginx:latest
      volumes:
          - ./:/code
      links:
          - php
  
    php:
      build: .
      volumes:
        - ./:/code
  </code></pre>
  
  <p>My dockerfile looks like this:</p>
  
  <pre><code>FROM php:7-fpm
  
  WORKDIR /code
  
  RUN touch testfile
  </code></pre>
  
  <p>Of course thats a simplified example, but why do I not see the "testfile" on my host System? if I use <code>docker-compose exec php touch testfile</code> everything works as expected, i see the testfile on my host.
  From my understanding I do need to see it outside of my container for it to be shared with the other containers with the same volume (in this example nginx)</p>