What is the difference between save and export in Docker?

前端 未结 6 1522
既然无缘
既然无缘 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:10

    Docker save Produces a tar file repo which contains all parent layers, and all tags + versions, or specified repo:tag, for each argument provided from image.

    Docker export Produces specified file(can be tar or tgz) with flat contents without contents of specified volumes from Container.

    docker save need to use on docker image while docker export need to use on container(just like running image)

    Save Usage

    docker save [OPTIONS] IMAGE [IMAGE...]

    Save an image(s) to a tar archive (streamed to STDOUT by default)

    --help=false Print usage -o, --output="" Write to a file, instead of STDOUT

    export Usage

    docker export [OPTIONS] CONTAINER

    Export the contents of a container's filesystem as a tar archive

    --help=false Print usage -o, --output="" Write to a file, instead of STDOUT

提交回复
热议问题