Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does all running docker containers have a separate process ID

Does all the running docker containers have a separate process id. If yes, how can one get that. Also, what will happen if we kill that process?

like image 364
Manohar Negi Avatar asked Dec 05 '22 05:12

Manohar Negi


1 Answers

Yes, every docker container will have a different PID on your host machine.

You can get a docker containers PID by doing:

docker inspect --format '{{ .State.Pid }}' CONTAINER_ID

If you kill the process on your host, your docker container will die.

like image 139
Chris McKinnel Avatar answered Jan 01 '23 22:01

Chris McKinnel