@@ -73,7 +73,6 @@ func setResources(s *specs.Spec, r containertypes.Resources) error {
7373 ThrottleReadIOPSDevice : readIOpsDevice ,
7474 ThrottleWriteIOPSDevice : writeIOpsDevice ,
7575 },
76- DisableOOMKiller : r .OomKillDisable ,
7776 Pids : & specs.LinuxPids {
7877 Limit : r .PidsLimit ,
7978 },
@@ -157,14 +156,14 @@ func setDevices(s *specs.Spec, c *container.Container) error {
157156}
158157
159158func setRlimits (daemon * Daemon , s * specs.Spec , c * container.Container ) error {
160- var rlimits []specs.LinuxRlimit
159+ var rlimits []specs.POSIXRlimit
161160
162161 // We want to leave the original HostConfig alone so make a copy here
163162 hostConfig := * c .HostConfig
164163 // Merge with the daemon defaults
165164 daemon .mergeUlimits (& hostConfig )
166165 for _ , ul := range hostConfig .Ulimits {
167- rlimits = append (rlimits , specs.LinuxRlimit {
166+ rlimits = append (rlimits , specs.POSIXRlimit {
168167 Type : "RLIMIT_" + strings .ToUpper (ul .Name ),
169168 Soft : uint64 (ul .Soft ),
170169 Hard : uint64 (ul .Hard ),
@@ -631,7 +630,7 @@ func (daemon *Daemon) populateCommonSpec(s *specs.Spec, c *container.Container)
631630 if err != nil {
632631 return err
633632 }
634- s .Root = specs.Root {
633+ s .Root = & specs.Root {
635634 Path : c .BaseFS ,
636635 Readonly : c .HostConfig .ReadonlyRootfs ,
637636 }
@@ -708,7 +707,6 @@ func (daemon *Daemon) createSpec(c *container.Container) (*specs.Spec, error) {
708707 if err := setResources (& s , c .HostConfig .Resources ); err != nil {
709708 return nil , fmt .Errorf ("linux runtime spec resources: %v" , err )
710709 }
711- s .Linux .Resources .OOMScoreAdj = & c .HostConfig .OomScoreAdj
712710 s .Linux .Sysctl = c .HostConfig .Sysctls
713711
714712 p := s .Linux .CgroupsPath
@@ -832,6 +830,7 @@ func (daemon *Daemon) createSpec(c *container.Container) (*specs.Spec, error) {
832830 }
833831 s .Process .SelinuxLabel = c .GetProcessLabel ()
834832 s .Process .NoNewPrivileges = c .NoNewPrivileges
833+ s .Process .OOMScoreAdj = & c .HostConfig .OomScoreAdj
835834 s .Linux .MountLabel = c .MountLabel
836835
837836 return (* specs .Spec )(& s ), nil
0 commit comments