Docker save: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=External= * https://docs.docker.com/engine/reference/commandline/save/ =Internal= * Image Operations =Overview=")
 
 
(6 intermediate revisions by the same user not shown)
Line 8: Line 8:


=Overview=
=Overview=
Takes an image name or ID and saves its content (as individual layers) into a TAR archive format. By default it dumps the content to stdout, so it must be redirected to a file.
docker save [''options''] <''image-id''>
docker save 6902f4d604b9 > postgresql-95-rhel7.tar
The flattened view of the image's filesystem can be obtained with:
<pre>
mkdir flat
cd flat
for i in $(cat ../manifest.json | sed -e 's/^.*Layers\":\[//' -e 's/\]}\]//' -e 's/"//g' -e 's/,/ /g'); do tar xfv ../$i; done
</pre>

Latest revision as of 04:33, 7 December 2017

External

Internal

Overview

Takes an image name or ID and saves its content (as individual layers) into a TAR archive format. By default it dumps the content to stdout, so it must be redirected to a file.

docker save [options] <image-id>
docker save 6902f4d604b9 > postgresql-95-rhel7.tar

The flattened view of the image's filesystem can be obtained with:

mkdir flat
cd flat
for i in $(cat ../manifest.json | sed -e 's/^.*Layers\":\[//' -e 's/\]}\]//' -e 's/"//g' -e 's/,/ /g'); do tar xfv ../$i; done