Skip to content

Commit 6d8fd60

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 <wking@tremily.us>
1 parent 60514d2 commit 6d8fd60

1 file changed

Lines changed: 1 addition & 107 deletions

File tree

generate.go

Lines changed: 1 addition & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -529,30 +529,10 @@ func getDefaultTemplate() (specs.LinuxSpec, specs.LinuxRuntimeSpec) {
529529
},
530530
Hostname: "shell",
531531
Mounts: []specs.MountPoint{
532-
{
533-
Name: "proc",
534-
Path: "/proc",
535-
},
536-
{
537-
Name: "dev",
538-
Path: "/dev",
539-
},
540-
{
541-
Name: "devpts",
542-
Path: "/dev/pts",
543-
},
544-
{
545-
Name: "shm",
546-
Path: "/dev/shm",
547-
},
548532
{
549533
Name: "mqueue",
550534
Path: "/dev/mqueue",
551535
},
552-
{
553-
Name: "sysfs",
554-
Path: "/sys",
555-
},
556536
},
557537
},
558538
Linux: specs.Linux{
@@ -577,36 +557,11 @@ func getDefaultTemplate() (specs.LinuxSpec, specs.LinuxRuntimeSpec) {
577557
rspec := specs.LinuxRuntimeSpec{
578558
RuntimeSpec: specs.RuntimeSpec{
579559
Mounts: map[string]specs.Mount{
580-
"proc": {
581-
Type: "proc",
582-
Source: "proc",
583-
Options: nil,
584-
},
585-
"dev": {
586-
Type: "tmpfs",
587-
Source: "tmpfs",
588-
Options: []string{"nosuid", "strictatime", "mode=755", "size=65536k"},
589-
},
590-
"devpts": {
591-
Type: "devpts",
592-
Source: "devpts",
593-
Options: []string{"nosuid", "noexec", "newinstance", "ptmxmode=0666", "mode=0620", "gid=5"},
594-
},
595-
"shm": {
596-
Type: "tmpfs",
597-
Source: "shm",
598-
Options: []string{"nosuid", "noexec", "nodev", "mode=1777", "size=65536k"},
599-
},
600560
"mqueue": {
601561
Type: "mqueue",
602562
Source: "mqueue",
603563
Options: []string{"nosuid", "noexec", "nodev"},
604564
},
605-
"sysfs": {
606-
Type: "sysfs",
607-
Source: "sysfs",
608-
Options: []string{"nosuid", "noexec", "nodev"},
609-
},
610565
},
611566
},
612567
Linux: specs.LinuxRuntime{
@@ -634,68 +589,7 @@ func getDefaultTemplate() (specs.LinuxSpec, specs.LinuxRuntimeSpec) {
634589
Soft: uint64(1024),
635590
},
636591
},
637-
Devices: []specs.Device{
638-
{
639-
Type: 'c',
640-
Path: "/dev/null",
641-
Major: 1,
642-
Minor: 3,
643-
Permissions: "rwm",
644-
FileMode: 0666,
645-
UID: 0,
646-
GID: 0,
647-
},
648-
{
649-
Type: 'c',
650-
Path: "/dev/random",
651-
Major: 1,
652-
Minor: 8,
653-
Permissions: "rwm",
654-
FileMode: 0666,
655-
UID: 0,
656-
GID: 0,
657-
},
658-
{
659-
Type: 'c',
660-
Path: "/dev/full",
661-
Major: 1,
662-
Minor: 7,
663-
Permissions: "rwm",
664-
FileMode: 0666,
665-
UID: 0,
666-
GID: 0,
667-
},
668-
{
669-
Type: 'c',
670-
Path: "/dev/tty",
671-
Major: 5,
672-
Minor: 0,
673-
Permissions: "rwm",
674-
FileMode: 0666,
675-
UID: 0,
676-
GID: 0,
677-
},
678-
{
679-
Type: 'c',
680-
Path: "/dev/zero",
681-
Major: 1,
682-
Minor: 5,
683-
Permissions: "rwm",
684-
FileMode: 0666,
685-
UID: 0,
686-
GID: 0,
687-
},
688-
{
689-
Type: 'c',
690-
Path: "/dev/urandom",
691-
Major: 1,
692-
Minor: 9,
693-
Permissions: "rwm",
694-
FileMode: 0666,
695-
UID: 0,
696-
GID: 0,
697-
},
698-
},
592+
Devices: []specs.Device{},
699593
Resources: &specs.Resources{
700594
Memory: specs.Memory{
701595
Swappiness: -1,

0 commit comments

Comments
 (0)