Squishing docker image without spinning a container
<p>I am using docker to analyse changes to the file system caused by various commands. I simply add relevant <code>RUN</code> lines in the <code>Dockerfile</code>, build it, use <code>docker save</code> to see what changes were made. Unfortunately I use many commands, end even though most of the time I can put several of them into one layer, I usually exceed the rather low 127 parent layers limit.</p>

<p>To deal with this I squish images with many layers into images with just one layer, and use the resulting image as the parent for the rest of the new layers. The best way to do that is to spin up a container and then use <code>docker export</code>, and then to <code>docker import</code> that to get a nice single layer of changes. I am looking for ways to shave down the time it takes to perform that operation.</p>

<p>Is there a simple way to do the same thing (export the fully expanded file system of an image, not just the layers stack as in <code>docker save</code>) without spinning up a container? </p>