简体   繁体   中英

Missing PID for process inside docker container

I'm running a simple web application inside a docker container. When I look at the output of netstat, the PID/Program name is blank.

root@fasf343344423# sudo netstat -tulnp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:5697 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:9090 0.0.0.0:* LISTEN -

I've seen the PID before on a different setup. So, I want to understand if this is because of a setup issue. Appreciate your help

I was able to resolve this with the following change:

  1. Edit /etc/apparmor.d/docker file and add the following line

    ptrace peer=docker-default,
  2. sudo service apparmor restart

As in my related question Which PID is using a PORT inside a k8s pod without net tools

The lack of POSIX Capability CAP_SYS_PTRACE avoids netstat to trace the inode to PID

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM