@@ -599,6 +599,8 @@ func setupNamespaces(spec *specs.Spec, context *cli.Context) {
599599 spec .Linux .Namespaces = linuxNs
600600}
601601
602+ func sPtr (s string ) * string { return & s }
603+
602604func getDefaultTemplate () specs.Spec {
603605 spec := specs.Spec {
604606 Version : specs .Version ,
@@ -646,8 +648,53 @@ func getDefaultTemplate() specs.Spec {
646648 },
647649 },
648650 Hostname : "shell" ,
649- Mounts : []specs.Mount {},
651+ Mounts : []specs.Mount {
652+ {
653+ Destination : "/proc" ,
654+ Type : "proc" ,
655+ Source : "proc" ,
656+ Options : nil ,
657+ },
658+ {
659+ Destination : "/dev" ,
660+ Type : "tmpfs" ,
661+ Source : "tmpfs" ,
662+ Options : []string {"nosuid" , "strictatime" , "mode=755" , "size=65536k" },
663+ },
664+ {
665+ Destination : "/dev/pts" ,
666+ Type : "devpts" ,
667+ Source : "devpts" ,
668+ Options : []string {"nosuid" , "noexec" , "newinstance" , "ptmxmode=0666" , "mode=0620" , "gid=5" },
669+ },
670+ {
671+ Destination : "/dev/shm" ,
672+ Type : "tmpfs" ,
673+ Source : "shm" ,
674+ Options : []string {"nosuid" , "noexec" , "nodev" , "mode=1777" , "size=65536k" },
675+ },
676+ {
677+ Destination : "/dev/mqueue" ,
678+ Type : "mqueue" ,
679+ Source : "mqueue" ,
680+ Options : []string {"nosuid" , "noexec" , "nodev" },
681+ },
682+ {
683+ Destination : "/sys" ,
684+ Type : "sysfs" ,
685+ Source : "sysfs" ,
686+ Options : []string {"nosuid" , "noexec" , "nodev" , "ro" },
687+ },
688+ },
650689 Linux : specs.Linux {
690+ Resources : & specs.Resources {
691+ Devices : []specs.DeviceCgroup {
692+ {
693+ Allow : false ,
694+ Access : sPtr ("rwm" ),
695+ },
696+ },
697+ },
651698 Namespaces : []specs.Namespace {
652699 {
653700 Type : "pid" ,
0 commit comments