Files
docker-docs/_data/engine-cli/docker_wait.yaml
French Ben a1933d276b New CLI added
Signed-off-by: French Ben <frenchben@docker.com>
2017-02-14 14:30:56 -08:00

36 lines
777 B
YAML

command: docker wait
short: Block until one or more containers stop, then print their exit codes
long: Block until one or more containers stop, then print their exit codes
usage: docker wait CONTAINER [CONTAINER...]
pname: docker
plink: docker.yaml
example: |-
Start a container in the background.
```bash
$ docker run -dit --name=my_container ubuntu bash
```
Run `docker wait`, which should block until the container exits.
```bash
$ docker wait my_container
```
In another terminal, stop the first container. The `docker wait` command above
returns the exit code.
```bash
$ docker stop my_container
```
This is the same `docker wait` command from above, but it now exits, returning
`0`.
```bash
$ docker wait my_container
0
```