I am playing around with Docker for a couple of days and I already made some images (which was really fun!). Now I want to persist my work and came to the save
and
There are two main differences between save
and export
commands.
save
command saves whole image with history and metadata but export
command exports only files structure (without history and metadata). So the exported tar file will be smaller then the saved one.
When you use exported file system for creating a new image then this new image will not contain any USER
, EXPOSE
, RUN
etc. commands from your Dockerfile. Only file structure will be transferred.
So when you are using mentioned keywords in your Dockerfile then you cannot use export command for transferring image to another machine - you need always use save command.