跳转至

docker restart

描述

重启一个或多个容器

帮助

# docker restart --help

Usage: docker restart [OPTIONS] CONTAINER [CONTAINER...]

Restart one or more containers

Options:
  -t, --time int Seconds to wait for stop before killing the container (default 10)
You have new mail in /var/spool/mail/root

参数

参数 默认 描述
-t, --time int 10 发送停止信号 SIGTERM 给容器主进程后,再等待多久后才发送 SIGKILL 给主进程停止运行。默认是等待10秒,可以根据进程的特性调整这个时间。

示例

$ docker restart my_container