https://pspdfkit.com/blog/2019/docker-import-export-vs-load-save/
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.
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)
Create an empty filesystem image and import the contents of the tarball
docker load
creates potentially multiple images from a tarred repository (sincedocker save
can save multiple images in a tarball).
To summarize what we’ve learned, we now know the following:
save
works with Docker images. It saves everything needed to build a container from scratch. Use this command if you want to share an image with others.load
works with Docker images. Use this command if you want to run an image exported withsave
. Unlikepull
, which requires connecting to a Docker registry,load
can import from anywhere (e.g. a file system, URLs).export
works with Docker containers, and it exports a snapshot of the container’s file system. Use this command if you want to share or back up the result of building an image.import
works with the file system of an exported container, and it imports it as a Docker image. Use this command if you have an exported file system you want to explore or use as a layer for a new image.
No comments:
Post a Comment