Use multi-stage docker files for outputting multiple images : <p>A new docker feature is to do something like this in the dockerfile</p>

<pre><code>FROM php7-fpm as build
...

FROM build AS test
...

FROM test AS staging
...
</code></pre>

<p>As far as i know, the last FROM statement marks the final output image. How is it possible to have two final images from one intermdiate image?</p>

<p>Like</p>

<pre><code>...
FROM build AS test
...
FROM test AS staging
...
FROM test AS prod
</code></pre>

<p>Test, staging and prod should not be discarded. I want to check in them into the repository.</p>
