зеркало из https://github.com/microsoft/docker.git
Add SYS_CHROOT cap to unprivileged containers
Fixes #6103 Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Родитель
f65fadbda0
Коммит
41f7cef2bd
|
@ -20,6 +20,7 @@ func New() *libcontainer.Container {
|
||||||
"SETFCAP",
|
"SETFCAP",
|
||||||
"SETPCAP",
|
"SETPCAP",
|
||||||
"NET_BIND_SERVICE",
|
"NET_BIND_SERVICE",
|
||||||
|
"SYS_CHROOT",
|
||||||
},
|
},
|
||||||
Namespaces: map[string]bool{
|
Namespaces: map[string]bool{
|
||||||
"NEWNS": true,
|
"NEWNS": true,
|
||||||
|
|
|
@ -873,3 +873,15 @@ func TestThatCharacterDevicesActLikeCharacterDevices(t *testing.T) {
|
||||||
|
|
||||||
logDone("run - test that character devices work.")
|
logDone("run - test that character devices work.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRunUnprivilegedWithChroot(t *testing.T) {
|
||||||
|
cmd := exec.Command(dockerBinary, "run", "busybox", "chroot", "/", "true")
|
||||||
|
|
||||||
|
if _, err := runCommand(cmd); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteAllContainers()
|
||||||
|
|
||||||
|
logDone("run - unprivileged with chroot")
|
||||||
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче