I understand the difference between export
(for containers) and save
(for images). But at the end of the day the tarball produced by either save or export should be used as an image.
So why are there 2 commands to make an image from a tarball?
I understand the difference between export
(for containers) and save
(for images). But at the end of the day the tarball produced by either save or export should be used as an image.
So why are there 2 commands to make an image from a tarball?
docker save
will indeed produce a tarball, but with all parent layers, and all tags + versions.docker export
does also produce a tarball, but without any layer/history.It is often used when one wants to "flatten" an image, as illustrated in "Flatten a Docker container or image" from Thomas Uhrig:
However, once those tarballs are produced, load/import are there to:
docker import
creates one image from one tarball which is not even an image (just a filesystem you want to import as an image)docker load
creates potentially multiple images from a tarred repository (sincedocker save
can save multiple images in a tarball).