docker wait¶
描述¶
等待1个或多个容器 stop 停止后输出其退出码。在容器没有退出前,该命令会一直阻塞,可以通过 CTRL+c
退出。
帮助¶
$ docker wait --help
Usage: docker wait CONTAINER [CONTAINER...]
Block until one or more containers stop, then print their exit codes
示例¶
启动一个容器
运行 docker wait
,一直等到容器停止。
在另外一个终端停止该容器
返回 docker wait
终端查看容器已经退出有返回码