I may be asking a very beginner level question but I need a way to distinguish process under docker and that under non-docker in a box. The ‘ps’ command command output gives me a feeling that process is running in linux box and cannot confirm if same is under hood of docker.

In the same context is it possible / feasible that process under docker be started with docker root file system.

The command lxc-ls and the command lxc-ps may be installable on your Linux distribution. This will allow you to list the running LXC containers and the processes running within those containers respectively. You should be able to link the output from lxc-ls to lxc-ps using streams and get a list of all containerized processes.

The big caveat is that you specified Docker and not every Docker instance is running on LXC nor is it necessarily a localhost process. Docker defines an API that can be called to list remote Docker instances, so this technique will not help with enumerating processes on remote machines as well.

In windows docker behave little bit different.
It’s processes are not run as child of parent process, but running as separate process on the host.

They can be viewed by (for example), powershell, like

Get-Process powershell

For example, getting processes on the host when running microsoft/iis container will include additional powershell process (since ms/iis container runs powershell as a main executable process).