ps doesn't list processes in Docker containers
So it is quite a common thing when setting up Docker containers to have scripts run inside of them that run `ps` in order to check whether a process is running.
However, Alpine appears to set `kernel.grsecurity.chroot_findtask`, which for some reason prevents ps from displaying all the processes that are launched in a container when Docker starts it.
Instead, it might just list “sh” as the process, while completely hiding other processes started by that sh process.
What’s extremely odd is that if I attach to a shell in the container after it’s started, and then run a command, and then attach to another shell in the container (in another window), then that command will appear in the process listing.
Why it is that processes which are started by Docker in the container (at launch) are hidden, while processes that are started after launch (via an attached shell) are not, is a complete mystery to me.
For now I’m forced to completely disabled kernel.grsecurity.chroot_findtask as a workaround.
(from redmine: issue id 8216, created on 2017-12-01)