# 20190320

{% embed url="<http://www.runoob.com/docker/docker-commit-command.html>" %}

如果想在容器內看到ip位置

```
# yum install net-tools
```

![](/files/-LaOy0z7Am7ZN3R4wkPr)

![](/files/-LaOyEHqaDDu4YHWdJYj)

可以在開另一台容器架好ip然後ping看看

![](/files/-LaOykpRSjhSrer7x4Pc)

可以看到2個容器可以互相ping到

如果想要再進去之前的容器內，可以執行:

```
docker start [ID] or [名稱]
docker attach [ID] or [名稱]
```

```
# docker start 2f7
# docker attach 2f7
# docker stop 2f7
```

如果想要在同一個容器內執行多個終端機時

```
# docker exec -it 2f7 /bin/bash
```

![](/files/-LaP2j_Qd8ObrZPfbkoq)

複製容器

```
#docker commit [ID] [新的容器名稱]:0.1
```

![](/files/-LaP38sAYsduAsov5LVI)

```
# docker run -it --name=[新名稱] test:0.1 /bin/bash
```

![複製過的容器會保有原來容器內的東西](/files/-LaP3Y2ahEmd-LlkMIDI)

將容器上傳

![](/files/-LaP4KSQBvgwweNjz1hE)

![成功上傳docker hub](/files/-LaP4eqCk9NYw1j5-V71)

刪除images檔，從docker hub上下載回來。

```
# docker rmi [docker hub 帳號]/test:0.1
```

![](/files/-LaP5kcr_AetoGW7RcFH)

成功將檔案抓回來了。


---

# 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/20190320.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.
