1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #6171 from crosbymichael/add-chroot

Add SYS_CHROOT cap to unprivileged containers
This commit is contained in:
Victor Marmol 2014-06-02 18:33:34 -07:00
commit 5bf4068d60
2 changed files with 13 additions and 0 deletions

View file

@ -20,6 +20,7 @@ func New() *libcontainer.Container {
"SETFCAP",
"SETPCAP",
"NET_BIND_SERVICE",
"SYS_CHROOT",
},
Namespaces: map[string]bool{
"NEWNS": true,

View file

@ -873,3 +873,15 @@ func TestThatCharacterDevicesActLikeCharacterDevices(t *testing.T) {
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")
}