Files created in docker build not present in container created from image
<p>I have the following Dockerfile</p>

<pre><code>FROM wordpress

#make sure necessary tools for publishing are installed
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash - &amp;&amp; \
    apt-get install -y nodejs git &amp;&amp; \
    npm install -g npm gulp bower

ADD . /var/www/html/wp-content/themes/theme-name

RUN cd /var/www/html/wp-content/themes/theme-name \
    &amp;&amp; npm install \
    &amp;&amp; npm run build \
    &amp;&amp; rm -rf node_modules \
    &amp;&amp; rm -rf bower_components \
    &amp;&amp; find ./* -type f -printf "%h%f\n" | sort \
    &amp;&amp; cd /

VOLUME ["/var/www/html/wp-content/themes/ca-ticket.com"]

ENTRYPOINT ["/entrypoint.sh"]
CMD ["apache2-foreground"]
</code></pre>

<p>When I build it, the second RUN command produces several files that get dropped into the <code>/var/www/html/wp-content/themes/ca-ticket.com/dist</code> folder, and when I view the build log I can see clearly that the files are getting created (that is why the <code>find ./* -type f -printf "%h%f\n" | sort</code> is there. </p>

<p>From the log:</p>

<pre><code>build   11-Apr-2016 18:51:01    ./dist/scriptsjquery.js
build   11-Apr-2016 18:51:01    ./dist/scriptsjquery.js.map
build   11-Apr-2016 18:51:01    ./dist/scriptsmain.js
build   11-Apr-2016 18:51:01    ./dist/scriptsmain.js.map
build   11-Apr-2016 18:51:01    ./dist/stylesmain.css
build   11-Apr-2016 18:51:01    ./dist/stylesmain.css.map
</code></pre>

<p>... and so on. </p>

<p>However, when I create a container from this image, the <code>/var/www/html/wp-content/themes/ca-ticket.com/dist</code> simply doesn't exist!</p>

<p>I'm suspect I must be doing something silly to cause docker to ignore a layer, but I'm not sure what is wrong about this process.</p>

<p><strong>edit:</strong>
The build command is:</p>

<pre><code>docker build --force-rm=true --tag="&lt;tag here&gt;" /path/to/context
</code></pre>

<p>I've also tried with the <code>--no-cache</code> option with no change to the result.</p>

<p>I'm running the image with:</p>

<pre><code>docker run --name &lt;name&gt; -d -p 81:80 -e WORDPRESS_DB_HOST=&lt;dbhost&gt; -e WORDPRESS_DB_USER=&lt;dbuser&gt; -e WORDPRESS_DB_PASSWORD=&lt;pass&gt; -e WORDPRESS_DB_NAME=&lt;dbname&gt; -e WORDPRESS_TABLE_PREFIX=&lt;tblprefix&gt; &lt;imagename&gt;
</code></pre>