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

How to check the PID of a docker container

王林
Release: 2020-08-13 17:19:40
forward
5670 people have browsed it

How to check the PID of a docker container

1. docker container top

(Recommended tutorial: docker tutorial)

[xxx@single xxx]# docker container top <container>
Copy after login

Using redis example

[xxx@single xxx]# docker container top redis
Copy after login

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

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

2. Docker container inspect

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

Using redis as an example

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

This command will directly output the PID

2208
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template