Looking around, I found that I can use
docker run --privileged --rm -i -t app /bin/bash
It also gave access to all ptrace functions for all processes belonging to any user. Unfortunately, I do not want others to have this opportunity. So I looked at apparmor and found that I can use
ptrace peer=@{profile_name}
inside my aparmor profile, which I then included when starting the application.
docker run --security-opt="apparmor:myprofile" --rm -i -t app /bin/bash
All shipments are in order. Then I use fuser (as root), and as expected, I can see the processes owned by root. But I have several processes running uucp, which gives permission to refuse.
So, I am switching to bash under uucp.
sudo -u uucp /bin/bash
But using fuser or lsof does not work and returns nothing.
So, how do I activate ptrace for any user when I am active as a user in docker docker?