一、docker container top
(推荐教程:docker教程)
[xxx@single xxx]# docker container top <container>
以redis示例
[xxx@single xxx]# docker container top redis
从输出结果中可以看到redis容器的PID
PID USER TIME COMMAND 2208 999 1:47 redis-server *:637912
二、docker container inspect
[xxx@single xxx]# docker inspect -f '{{.State.Pid}}' <container>1
以redis示例
[xxx@single xxx]# docker inspect -f '{{.State.Pid}}' redis1
此命令会直接输出PID
2208
以上就是怎样查看docker容器的PID的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号