What is the difference between save and export in Docker?

前端 未结 6 1520
既然无缘
既然无缘 2021-01-29 17:52

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

6条回答
  •  礼貌的吻别
    2021-01-29 18:21

    There are two main differences between save and export commands.

    1. 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.

    2. 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.

提交回复
热议问题