-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker-run: add Chinese translation (#13281)
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# docker run | ||
|
||
> 创建一个新的容器并运行命令。 | ||
> 更多信息:<https://docs.docker.com/engine/reference/commandline/run/>. | ||
- 使用打上标签的 Docker 镜像的新容器中执行命令: | ||
|
||
`docker run {{镜像:标签}} {{命令}}` | ||
|
||
- 在后台运行新容器中的命令,并输出其容器ID: | ||
|
||
`docker run --detach {{镜像}} {{命令}}` | ||
|
||
- 以交互模式和伪终端启动一个容器,并执行指定的命令: | ||
|
||
`docker run --rm --interactive --tty {{镜像}} {{命令}}` | ||
|
||
- 在新容器中传入环境变量并运行指定命令: | ||
|
||
`docker run --env '{{变量名}}={{变量值}}' --env {{变量名=变量值}} {{镜像}} {{命令}}` | ||
|
||
- 在新容器中挂载目录卷并运行指定命令: | ||
|
||
`docker run --volume {{宿主机路径}}:{{容器内路径}} {{镜像}} {{命令}}` | ||
|
||
- 在新容器中开放映射端口并运行指定命令: | ||
|
||
`docker run --publish {{宿主机端口}}:{{容器内端口}} {{镜像}} {{命令}}` | ||
|
||
- 在新容器中覆盖镜像中 ENTRYPOINT 并运行指定命令: | ||
|
||
`docker run --entrypoint {{命令}} {{镜像}}` | ||
|
||
- 在新容器中设定使用需使用的网络并运行指定命令: | ||
|
||
`docker run --network {{网络}} {{镜像}}` |