Root is not all or nothing on Linux. Its powers are split into capabilities, and a process can have some of them without being root, or be root without most of them. capsh --print shows the set you are working with.
Run it in any shell, or inside a container:
capsh --print
docker run --rm --cap-drop ALL --cap-add NET_BIND_SERVICE IMAGE capsh --print | head -2
The second command runs any image that has capsh with only one capability; its output shows just cap_net_bind_service. The Current: line lists the capabilities in effect, like cap_chown, cap_net_bind_service or cap_sys_admin. Bounding set is the maximum this process and its children can ever get. The Securebits line also shows whether no-new-privs is set.
I find this explains a lot of container puzzles. In a default Docker container as root, the list is short. There’s cap_chown, cap_dac_override and cap_net_bind_service, but no cap_sys_admin or cap_net_admin. That’s why some things fail in a container even as root: the permission bits say yes, but a missing capability says no.
To read the same information for another process, look at its status file and decode it:
grep Cap /proc/1234/status
capsh --decode=00000000a80425fb
On Ubuntu and Debian, capsh comes in the libcap2-bin package. Many slim container images don’t have it, so the /proc method is the one that works everywhere.
Further reading: capsh(1) manual page, capabilities(7) manual page