4-Docker命令之docker restart

1.docker restart介绍

docker restart命令是用来重新启动一个或多个docker容器。

2.docker restart用法

docker restart [参数] container [container......]

[root@centos79 ~]# docker restart --help

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

Restart one or more containers

Aliases:
  docker container restart, docker restart

Options:
  -s, --signal string   Signal to send to the container
  -t, --time int        Seconds to wait before killing the container
[root@centos79 ~]# 

3.实例

3.1.基于container id重启容器

命令:

docker restart 20ce

[root@centos79 ~]# docker ps -a | grep 20ce
20cebbe3fac3   daocloud.io/library/centos:latest   "/bin/bash"               3 days ago    Up About a minute                                                                                          centos-ztj
[root@centos79 ~]# docker restart 20ce
20ce
[root@centos79 ~]# docker 

猜你喜欢

转载自blog.csdn.net/z19861216/article/details/134523521
今日推荐