(推荐教程:docker教程)
[xxx@single xxx]# docker container top <container>
以redis示例
[xxx@single xxx]# docker container top redis
从输出结果中可以看到redis容器的pid
pid user time command2208 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的详细内容。
