mirror of
https://github.com/yeasy/docker_practice.git
synced 2024-12-25 14:38:54 +00:00
Remove english
This commit is contained in:
parent
c9ee2a34e4
commit
766f3015aa
@ -1,4 +1,4 @@
|
||||
## 后台(background)运行
|
||||
## 后台运行
|
||||
|
||||
更多的时候,需要让 Docker 在后台运行而不是直接把执行命令的结果输出在当前宿主机下。此时,可以通过添加 `-d` 参数来实现。
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
如果不使用 `-d` 参数运行容器。
|
||||
|
||||
```bash
|
||||
$ docker run ubuntu:14.04 /bin/sh -c "while true; do echo hello world; sleep 1; done"
|
||||
$ docker run ubuntu:17.10 /bin/sh -c "while true; do echo hello world; sleep 1; done"
|
||||
hello world
|
||||
hello world
|
||||
hello world
|
||||
@ -19,7 +19,7 @@ hello world
|
||||
如果使用了 `-d` 参数运行容器。
|
||||
|
||||
```bash
|
||||
$ docker run -d ubuntu:14.04 /bin/sh -c "while true; do echo hello world; sleep 1; done"
|
||||
$ docker run -d ubuntu:17.10 /bin/sh -c "while true; do echo hello world; sleep 1; done"
|
||||
77b2dc01fe0f3f1265df143181e7b9af5e05279a884f4776ee75350ea9d8017a
|
||||
```
|
||||
|
||||
@ -32,7 +32,7 @@ $ docker run -d ubuntu:14.04 /bin/sh -c "while true; do echo hello world; sleep
|
||||
```bash
|
||||
$ docker ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
77b2dc01fe0f ubuntu:14.04 /bin/sh -c 'while tr 2 minutes ago Up 1 minute agitated_wright
|
||||
77b2dc01fe0f ubuntu:17.10 /bin/sh -c 'while tr 2 minutes ago Up 1 minute agitated_wright
|
||||
```
|
||||
|
||||
要获取容器的输出信息,可以通过 `docker logs` 命令。
|
||||
|
Loading…
Reference in New Issue
Block a user