From 080ee00eacec418d64c1eb3aa9ae7268701a271c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 5 Dec 2015 12:51:57 -0800 Subject: [PATCH] generate: Drop runtime-supplied devices and mounts Since opencontainers/specs#164 (part of the v0.1.1 release [1]), Linux runtimes are required to supply these devices and mounts. Specifying them explicitly in the config should have no effect, and just makes the config longer than it needs to be. [1]: https://github.com/opencontainers/specs/blob/v0.1.1/config-linux.md#default-devices-and-file-systems Signed-off-by: W. Trevor King --- generate.go | 66 ++--------------------------------------------------- 1 file changed, 2 insertions(+), 64 deletions(-) diff --git a/generate.go b/generate.go index 1aac0f0bc..e83145c84 100644 --- a/generate.go +++ b/generate.go @@ -619,32 +619,7 @@ func getDefaultTemplate() specs.LinuxSpec { Cwd: "/", }, Hostname: "shell", - Mounts: []specs.Mount{ - { - Destination: "/proc", - Type: "proc", - Source: "proc", - Options: nil, - }, - { - Destination: "/dev/pts", - Type: "devpts", - Source: "devpts", - Options: []string{"nosuid", "noexec", "newinstance", "ptmxmode=0666", "mode=0620", "gid=5"}, - }, - { - Destination: "/dev/shm", - Type: "tmpfs", - Source: "shm", - Options: []string{"nosuid", "noexec", "nodev", "mode=1777", "size=65536k"}, - }, - { - Destination: "/sys", - Type: "sysfs", - Source: "sysfs", - Options: []string{"nosuid", "noexec", "nodev"}, - }, - }, + Mounts: []specs.Mount{}, }, Linux: specs.Linux{ Capabilities: []string{ @@ -687,44 +662,7 @@ func getDefaultTemplate() specs.LinuxSpec { Soft: uint64(1024), }, }, - Devices: []specs.Device{ - { - Type: 'c', - Path: "/dev/null", - Major: 1, - Minor: 3, - }, - { - Type: 'c', - Path: "/dev/random", - Major: 1, - Minor: 8, - }, - { - Type: 'c', - Path: "/dev/full", - Major: 1, - Minor: 7, - }, - { - Type: 'c', - Path: "/dev/tty", - Major: 5, - Minor: 0, - }, - { - Type: 'c', - Path: "/dev/zero", - Major: 1, - Minor: 5, - }, - { - Type: 'c', - Path: "/dev/urandom", - Major: 1, - Minor: 9, - }, - }, + Devices: []specs.Device{}, }, }