# 操作映像檔

## **映像檔儲存**

**使用 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/docker-cong-an-zhuang-dao-ying-yong-ru-men-pian/cao-zuo-ying-xiang-dang.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
