1

According to Docker Processes Shown on Host Process List, if I run "ps" command on host machine, I should be able to see all processes running in docker container. But the actual result on my Synology NAS is different.

For example, I start the python cli in my docker container:

sh-4.2# python
Python 2.7.5 (default, Oct 14 2020, 14:45:30)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

Then I run ps command in my host machine:

nas_user@my-nas:sudo ps aux | grep python
nas_user 29245  0.0  0.0  23140  2280 pts/16   S+   00:03   0:00 grep --color=auto python

No python process is shown in host machine.

But if I start another session and connect to the container, I can see the python process:

sh-4.2# ps aux | grep python
root     12745  0.0  0.1  26560  6192 pts/6    S+   07:03   0:00 python
root     12826  0.0  0.0   9104   876 pts/7    S+   07:07   0:00 grep python

What's wrong with my steps? Do I misunderstand something here?

xnervwang
  • 125
  • 1
  • 8
  • To view the processes inside the container, it is recommended that you use the following command. `docker container top ContainerName` – rezshar Jul 11 '21 at 07:57
  • Are you on the same host? Is docker running containers remotely, or in a VM, in your environment? What is `$DOCKER_HOST` set to? – BMitch Dec 03 '21 at 00:57
  • Another way to check for the same host: `hostname; docker run --rm --uts host busybox hostname` – BMitch Dec 03 '21 at 00:59
  • The container runs on the same host. I suspect the Synology OS is a little different than the common Linux kernel. Now I'm asking in their forum. – xnervwang Dec 03 '21 at 06:08

0 Answers0