docker/docker — pull request #9591 by jlhawn (2014-12-10 11:27:55+00:00)
Title: Adds build option to squash newly built layers

This patch brings support for a `--squash` option to `docker build`.
If used, before a build completes like it normally would, it consolidates all
newly built layers, making all build steps result in only a single new image.

THIS DOES NOT AFFECT BUILD CACHE IN ANY WAY!

That's right, you still get all the advantages of the build cache (assuming
you don't specify `--no-cache` that is). An image built with the `--squash`
option still produces a layer for each built step, but also a second image
which has all of the changes consolidated into one layer.

If you use the `--tag` option along with `--squash`, it is the squashed layer
which gets tagged.

Docker-DCO-1.1-Signed-off-by: Josh Hawn (github: jlhawn)