mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 12:21:17 +00:00
chore: remove unused historic image files
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
### 启动方式概述
|
||||
|
||||
启动容器有两种方式:
|
||||
|
||||
- **新建并启动**:基于镜像创建新容器
|
||||
- **重新启动**:将已终止的容器重新运行
|
||||
|
||||
@@ -46,8 +47,8 @@ root@af8bae53bdd3:/#
|
||||
|
||||
| 参数 | 作用 |
|
||||
|------|------|
|
||||
| `-i` | 保持标准输入(stdin)打开,允许输入 |
|
||||
| `-t` | 分配伪终端(pseudo-TTY),提供终端界面 |
|
||||
| `-i` | 保持标准输入 (stdin) 打开,允许输入 |
|
||||
| `-t` | 分配伪终端 (pseudo-TTY),提供终端界面 |
|
||||
| `-it` | 两者组合使用,获得交互式终端 |
|
||||
|
||||
在交互模式下可以执行命令:
|
||||
@@ -87,9 +88,11 @@ flowchart TD
|
||||
|
||||
#### 基础选项
|
||||
|
||||
相关信息如下表:
|
||||
|
||||
| 选项 | 说明 | 示例 |
|
||||
|------|------|------|
|
||||
| `-d` | 后台运行(detach) | `docker run -d nginx` |
|
||||
| `-d` | 后台运行 (detach)| `docker run -d nginx` |
|
||||
| `-it` | 交互式终端 | `docker run -it ubuntu bash` |
|
||||
| `--name` | 指定容器名称 | `docker run --name myapp nginx` |
|
||||
| `--rm` | 退出后自动删除容器 | `docker run --rm ubuntu echo hi` |
|
||||
|
||||
Reference in New Issue
Block a user