Identify in wich container runs a process?

I have identified from the host a process by its PID. How to easily determine in which container it is running?

I know “ps fauxww”, or even looping each CT+ps -ef + filtering, but I’d prefer something more efficient.

Same question if I have identified a or several process by their user ID. How to identify to which container this user ID belongs to ?

Happy New Year!

You could try to guess from the cgroup in /proc/PID/cgroup

Brilliant. Thank you!