# 20190327

查詢docker資訊

```
# docker inspect [id]
```

![](/files/-Laxj60lFUkddCcl5aCE)

執行docker httpd

```
# docker run -d -p 8080:80 httpd
```

![](/files/-LaxjmbbQZn9h95VWUKp)

成功的網頁會像這樣

![](/files/-LaxkDllbA7Fb2w7lMF0)

接下來創建一個資料夾叫mydata

![](/files/-Laxkvgt7nT8kM7D_K92)

執行

```
# docker run -it --rm -v /mydata:/data centos /bin/bash
```

![](/files/-LaxlMUlpYoCWShI0FcT)

成功後root會變成這樣

![](/files/-LaxlcNoNJ6OgDwZfyG5)

切換到data資料夾底下

![](/files/-Laxloe9iSkC5PB95NyQ)

在資料夾底下創建任意文檔

```
# echo "hi" > a.txt
```

![](/files/-LaxmK3mcv7MslicWuI7)

開啟新的終端機切換到mydata資料夾下

確認資料夾下有沒有"a.txt"檔

![](/files/-LaxnmgjfwOGxOBwd3j3)

你也可以在mydata資料夾下創建文件

確認data資料夾是否跟mydata同步

![](/files/-Laxo7k5GynriImKm-rX)

![](/files/-LaxoPrgtoZPzRCrOKEy)


---

# 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://cf337188.gitbook.io/01/20190327.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.
