> For the complete documentation index, see [llms.txt](https://kawsing.gitbook.io/opensystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kawsing.gitbook.io/opensystem/docker-cong-an-zhuang-dao-ying-yong-ru-men-pian/cao-zuo-ying-xiang-dang.md).

# 操作映像檔

## **映像檔儲存**

**使用 docker save 命令**

**docker save -o ubuntu\_18.04.tar ubuntu**

**ubuntu\@ubuntuserver:\~$ ls -lh**\
**total 82M**\
**-rw------- 1 ubuntu ubuntu 82M Jul 24 06:19 ubuntu\_18.04.tar**\
**將映像檔打包，可以轉移到其他HOST機使用**<br>

**這樣的作法，很適合於將現有運作穩定的服務遷移到新的HOST繼續運作原有的服務，比如你可以將16.04的image，放到 18.04 HOST中，運作原有於16.04中穩定的服務，也可以是其他類型的 HOST，如CentOS，只要他們可以執行docker即可**

## **映像檔載入**

**可以使用 docker load 載入之前save的映像檔，我們可以在安裝一台新的HOST，把檔案scp過去，並使用docker load載入相同的映像檔**

**測試：**

**docker rmi 原來的映像檔**

**docker load < ubuntu\_18.04.tar**<br>
