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:40 5502browse

How to check the PID of a docker container

1. docker container top

(Recommended tutorial:docker tutorial)

[xxx@single xxx]# docker container top 

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 '{{.State.Pid}}' 1

Using redis as an example

[xxx@single xxx]# docker inspect -f '{{.State.Pid}}' 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