Skip to content

Commit 080ee00

Browse files
committed
generate: Drop runtime-supplied devices and mounts
Since opencontainers/runtime-spec#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 <[email protected]>
1 parent 07b481e commit 080ee00

1 file changed

Lines changed: 2 additions & 64 deletions

File tree

generate.go

Lines changed: 2 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -619,32 +619,7 @@ func getDefaultTemplate() specs.LinuxSpec {
619619
Cwd: "/",
620620
},
621621
Hostname: "shell",
622-
Mounts: []specs.Mount{
623-
{
624-
Destination: "/proc",
625-
Type: "proc",
626-
Source: "proc",
627-
Options: nil,
628-
},
629-
{
630-
Destination: "/dev/pts",
631-
Type: "devpts",
632-
Source: "devpts",
633-
Options: []string{"nosuid", "noexec", "newinstance", "ptmxmode=0666", "mode=0620", "gid=5"},
634-
},
635-
{
636-
Destination: "/dev/shm",
637-
Type: "tmpfs",
638-
Source: "shm",
639-
Options: []string{"nosuid", "noexec", "nodev", "mode=1777", "size=65536k"},
640-
},
641-
{
642-
Destination: "/sys",
643-
Type: "sysfs",
644-
Source: "sysfs",
645-
Options: []string{"nosuid", "noexec", "nodev"},
646-
},
647-
},
622+
Mounts: []specs.Mount{},
648623
},
649624
Linux: specs.Linux{
650625
Capabilities: []string{
@@ -687,44 +662,7 @@ func getDefaultTemplate() specs.LinuxSpec {
687662
Soft: uint64(1024),
688663
},
689664
},
690-
Devices: []specs.Device{
691-
{
692-
Type: 'c',
693-
Path: "/dev/null",
694-
Major: 1,
695-
Minor: 3,
696-
},
697-
{
698-
Type: 'c',
699-
Path: "/dev/random",
700-
Major: 1,
701-
Minor: 8,
702-
},
703-
{
704-
Type: 'c',
705-
Path: "/dev/full",
706-
Major: 1,
707-
Minor: 7,
708-
},
709-
{
710-
Type: 'c',
711-
Path: "/dev/tty",
712-
Major: 5,
713-
Minor: 0,
714-
},
715-
{
716-
Type: 'c',
717-
Path: "/dev/zero",
718-
Major: 1,
719-
Minor: 5,
720-
},
721-
{
722-
Type: 'c',
723-
Path: "/dev/urandom",
724-
Major: 1,
725-
Minor: 9,
726-
},
727-
},
665+
Devices: []specs.Device{},
728666
},
729667
}
730668

0 commit comments

Comments
 (0)