Article 53YEH Why do pids jump in a container?

Why do pids jump in a container?

by
YuvalAvra
from LinuxQuestions.org on (#53YEH)
Entering a container (e.g. `docker run` or `docker exec`) makes the PID of next created process jump ahead, why is that?

For example, in the image below the second process in the container (`ps`) is assigned PID 10, not PID 2:
Attachment 33283

According to this answer, Linux appears to be allocating PIDs in a sequence, is that not the case?
Attached Thumbnailsattachment.php?attachmentid=33283&stc=1& latest?d=yIl2AUoC8zA latest?i=3dpt22XzVEo:WVotzHd9cqM:F7zBnMy latest?i=3dpt22XzVEo:WVotzHd9cqM:V_sGLiP latest?d=qj6IDK7rITs latest?i=3dpt22XzVEo:WVotzHd9cqM:gIN9vFw3dpt22XzVEo
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments