Home  >  Article  >  Operation and Maintenance  >  How to check the PID of a docker container

How to check the PID of a docker container

王林
王林forward
2020-08-13 17:19:405646browse

How to check the PID of a docker container

1. docker container top

(Recommended tutorial: docker tutorial)

[xxx@single xxx]# docker container top <container>

Using redis example

[xxx@single xxx]# docker container top redis

You can see the PID of the redis container from the output result

PID        USER        TIME        COMMAND
2208        999        1:47        redis-server *:637912

2. Docker container inspect

[xxx@single xxx]# docker inspect -f &#39;{{.State.Pid}}&#39; <container>1

Using redis as an example

[xxx@single xxx]# docker inspect -f &#39;{{.State.Pid}}&#39; redis1

This command will directly output the PID

2208

The above is the detailed content of How to check the PID of a docker container. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete