Docker save/load 與 export/import

export/import

Description
Export a container’s filesystem as a tar archive
將容器導(dǎo)出為tar文件.

命令

  • export
docker export <container id/name>  > latest.tar
docker export --output=" latest.tar"  <container id/name>
image.png
  • import

Description
Import the contents from a tarball to create a filesystem image
將export導(dǎo)出tar包導(dǎo)入

# 從文件 URL 中導(dǎo)入
docker import [OPTIONS] file|URL|- [REPOSITORY[:TAG]] 
cat exampleimage.tgz | docker import  -  exampleimagelocal:new
image.png

  • save

Description
Save one or more images to a tar archive (streamed to STDOUT by default)
將鏡像保存至tar文件中

 docker save busybox > busybox.tar
 docker save -o fedora-all.tar fedora
image.png
  • load

Description
Load an image from a tar archive or STDIN
從文件或者標(biāo)準(zhǔn)輸入 載入 鏡像

docker load < alpine.tar.gz

image.png
  • commit

Description
Create a new image from a container’s changes

容器最上層為R/W 保存修改后容器

docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
docker commit  alpine apline:v1

commit 提交容器為黑箱操作。建議使用Dockerfile,操作步驟明確可查。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容