> For the complete documentation index, see [llms.txt](https://lujw666.gitbook.io/learn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lujw666.gitbook.io/learn/docker/00-basic/08-ming-ling.md).

# Docker 命令大全

![Docker命令图](/files/-MSmK1C6ytag3uznFBrh)

## 容器生命周期管理

* [run](/learn/docker/00-basic/08-ming-ling/rong-qi-sheng-ming-zhou-qi-guan-li/run.md) 创建一个新的容器并运行一个命令
* [start/stop/restart](/learn/docker/00-basic/08-ming-ling/rong-qi-sheng-ming-zhou-qi-guan-li/start-stop-restart.md) 启动/停止/重启一个容器
* [kill](/learn/docker/00-basic/08-ming-ling/rong-qi-sheng-ming-zhou-qi-guan-li/kill.md) 杀掉一个运行中的容器
* [rm](/learn/docker/00-basic/08-ming-ling/rong-qi-sheng-ming-zhou-qi-guan-li/rm.md) 删除一个或多个容器
* [pause/unpause](/learn/docker/00-basic/08-ming-ling/rong-qi-sheng-ming-zhou-qi-guan-li/pause-unpause.md) 暂停/恢复容器中所有的进程
* [create](/learn/docker/00-basic/08-ming-ling/rong-qi-sheng-ming-zhou-qi-guan-li/create.md) 创建一个新的容器但不启动它
* [exec](/learn/docker/00-basic/08-ming-ling/rong-qi-sheng-ming-zhou-qi-guan-li/exec.md) 在运行的容器中执行命令

## 容器操作

* [ps](/learn/docker/00-basic/08-ming-ling/rong-qi-cao-zuo/ps.md) 列出容器
* [inspect](/learn/docker/00-basic/08-ming-ling/rong-qi-cao-zuo/inspect.md) 获取容器/镜像的元数据
* [top](/learn/docker/00-basic/08-ming-ling/rong-qi-cao-zuo/top.md) 查看容器中运行的进程信息
* [attach](/learn/docker/00-basic/08-ming-ling/rong-qi-cao-zuo/attach.md) 连接到正在运行中的容器
* [events](/learn/docker/00-basic/08-ming-ling/rong-qi-cao-zuo/events.md) 从服务器获取实时事件
* [logs](/learn/docker/00-basic/08-ming-ling/rong-qi-cao-zuo/logs.md) 获取容器的日志
* [wait](/learn/docker/00-basic/08-ming-ling/rong-qi-cao-zuo/wait.md) 阻塞运行直到容器停止，然后打印出它的退出代码
* [export](/learn/docker/00-basic/08-ming-ling/rong-qi-cao-zuo/export.md) 将文件系统作为一个tar归档文件导出到STDOUT
* [port](/learn/docker/00-basic/08-ming-ling/rong-qi-cao-zuo/port.md) 列出指定的容器的端口映射

## 容器rootfs命令

* [commit](/learn/docker/00-basic/08-ming-ling/rong-qi-rootfs-ming-ling/commit.md) 从容器创建一个新的镜像
* [cp](/learn/docker/00-basic/08-ming-ling/rong-qi-rootfs-ming-ling/cp.md) 用于容器与主机之间的数据拷贝
* [diff](/learn/docker/00-basic/08-ming-ling/rong-qi-rootfs-ming-ling/diff.md) 检查容器里文件结构的更改

## 镜像仓库

* [login/logout](/learn/docker/00-basic/08-ming-ling/jing-xiang-cang-ku/login-logout.md) 登陆/登出Docker镜像仓库
* [pull](/learn/docker/00-basic/08-ming-ling/jing-xiang-cang-ku/pull.md) 从镜像仓库中拉取或者更新指定镜像
* [push](/learn/docker/00-basic/08-ming-ling/jing-xiang-cang-ku/push.md) 将本地的镜像上传到镜像仓库
* [search](/learn/docker/00-basic/08-ming-ling/jing-xiang-cang-ku/search.md) 从Docker Hub查找镜像

## 本地镜像管理

* [images](/learn/docker/00-basic/08-ming-ling/ben-di-jing-xiang-guan-li/images.md) 列出本地镜像
* [rmi](/learn/docker/00-basic/08-ming-ling/ben-di-jing-xiang-guan-li/rmi.md) 删除本地一个或多少镜像
* [tag](/learn/docker/00-basic/08-ming-ling/ben-di-jing-xiang-guan-li/tag.md) 标记本地镜像，将其归入某一仓库
* [build](/learn/docker/00-basic/08-ming-ling/ben-di-jing-xiang-guan-li/build.md) 用于使用 Dockerfile 创建镜像
* [history](/learn/docker/00-basic/08-ming-ling/ben-di-jing-xiang-guan-li/history.md) 查看指定镜像的创建历史
* [save](/learn/docker/00-basic/08-ming-ling/ben-di-jing-xiang-guan-li/save.md) 将指定镜像保存成 tar 归档文件
* [load](/learn/docker/00-basic/08-ming-ling/ben-di-jing-xiang-guan-li/load.md) 导入使用 docker save 命令导出的镜像
* [import](/learn/docker/00-basic/08-ming-ling/ben-di-jing-xiang-guan-li/import.md) 从归档文件中创建镜像


---

# 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://lujw666.gitbook.io/learn/docker/00-basic/08-ming-ling.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.
