> For the complete documentation index, see [llms.txt](https://moekiwisama-1.gitbook.io/minecraft-docker/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://moekiwisama-1.gitbook.io/minecraft-docker/shi-yong-docker-image-yun-hang-wo-men-de-di-yi-ge-docker-rong-qi-shi-li.md).

# 使用 Docker Image 运行我们的第一个 Docker 容器实例

安装完 docker 以后，我们可以使用指令

```bash
docker run hello-world
```

![](/files/-Mcxlpa0TlWO5jRiecwX)

### 发生了什么？

前文说到，docker image 就像是虚拟机磁盘镜像一样，是制作完成的东西。

我们这里有一个叫做 hello-world 的 docker image，它是别人制作完的一个 docker 镜像。\
docker 会先在本地寻找有没有一个叫做 hello-world 的 docker image，如果本地没有，就会去网上寻找（默认在 Docker Hub 寻找<https://hub.docker.com/_/hello-world>），找到了以后就会将它下载下来，并且运行这个容器。

一般虚拟机是按照操作系统来划分的，docker 一般是按照应用来划分的。操作系统关机，虚拟机会被关机，同样的，docker 实例中运行的应用结束了，那么该容器也会被关闭。

我们可以通过

```bash
docker ps -a
```

来查看所有容器的状态，这就好比是看虚拟机管理器左边那个条条一样

![虚拟机左边那个条条](/files/-McxnDWHlpo_8LqXXjmh)

只不过，一个是可视化的，一个是在终端上的。

![docker cli](/files/-McxnAKDQ2BrCXBgrn2E)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://moekiwisama-1.gitbook.io/minecraft-docker/shi-yong-docker-image-yun-hang-wo-men-de-di-yi-ge-docker-rong-qi-shi-li.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.
