Files changes not reflected in Docker image after rebuild
<p>I'm trying to set up two Docker images for my PHP web application (php-fcm) reversed proxied by NGINX. Ideally I would like all the files of the web application to be copied into the php-fcm based image and exposed as a volume. This way both containers (web and app) can access the files with NGINX serving the static files and php-fcm interpreting the php files.</p>

<p>docker-compose.yml</p>

<pre><code>version: '2'
services:
  web:
    image: nginx:latest
    depends_on:
      - app
    volumes:
      - ./site.conf:/etc/nginx/conf.d/default.conf
    volumes_from:
      - app
    links:
      - app
  app:
    build: .
    volumes:
      - /app
</code></pre>

<p>Dockerfile:</p>

<pre><code>FROM php:fpm
COPY . /app
WORKDIR /app
</code></pre>

<p>The above setup works as expected. However, when I make any change to the files and then do</p>

<pre><code>compose up --build
</code></pre>

<p>the new files are not picked up in the resulting images. This is despite the following message indicating that the image is indeed being rebuilt:</p>

<pre><code>Building app
Step 1 : FROM php:fpm
 ---&gt; cb4faea80358
Step 2 : COPY . /app
 ---&gt; Using cache
 ---&gt; 660ab4731bec
Step 3 : WORKDIR /app
 ---&gt; Using cache
 ---&gt; d5b2e4fa97f2
Successfully built d5b2e4fa97f2
</code></pre>

<p>Only removing all the old images does the trick.</p>

<p>Any idea what could cause this?</p>

<pre><code>$ docker --version
Docker version 1.11.2, build b9f10c9
$ docker-compose --version
docker-compose version 1.7.1, build 0a9ab35
</code></pre>