Is it possible to show the restart policy of a running Docker container?

前端 未结 4 2080
清歌不尽
清歌不尽 2021-02-04 23:50

When I create containers I\'m specifying a restart policy, but this is not shown in docker ps, and it doesn\'t appear any format string shows this either.

D

4条回答
  •  野的像风
    2021-02-05 00:05

    For single line of the code:

    docker ps|grep -v CON|awk '{print $1}'|while read line; do  docker inspect -f "{{ .HostConfig.RestartPolicy.Name }}" $line |xargs echo $line ;done
    

提交回复
热议问题