I have a docker container which runs perfectly fine in a kubernetes pod when privileged:true
is set in the specification. But when I run the same docker container, by giving all the linux capabilities, it is failing. In both cases the capability bitmask for the processes are same and as follows:
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000010000
SigIgn: 0000000000000004
SigCgt: 0000000000014002
CapInh: 0000003fffffffff
CapPrm: 0000003fffffffff
CapEff: 0000003fffffffff
CapBnd: 0000003fffffffff
CapAmb: 0000000000000000
So, is there any difference between Running a process as root vs Running a process with all the capabilities.
Update : As pointed out by @ctrl-alt-delor, Setting privilege:true
means that the container will have access to all devices on the host as well as same access to the host as processes running outside containers on the host
CAP_SYS_ADMIN
set. Since 2.2, Linux kernel stopped looking forUID == 0
on many places in favor of the capabilities system. But, your case should be a corner case. What operation(disk, net, cpu, fork...) are you doing that is creating the failure on your software?passwd
which does not ask for a password when initiated by root. Other software is frequently configured to give root special privileges. These which cannot privileges possibly be included in the Kernel's capabilities model.