@@ -24,6 +24,7 @@ var createFlags = []cli.Flag{
24
24
cli.IntFlag {Name : "cpushares" , Usage : "set the cpushares for the container" },
25
25
cli.IntFlag {Name : "memory-limit" , Usage : "set the memory limit for the container" },
26
26
cli.IntFlag {Name : "memory-swap" , Usage : "set the memory swap limit for the container" },
27
+ cli.IntFlag {Name : "memory-swappiness" , Usage : "set the memory swappiness value (0-100 inclusive) for the container" },
27
28
cli.IntFlag {Name : "parent-death-signal" , Usage : "set the signal that will be delivered to the process in case the parent dies" },
28
29
cli.IntFlag {Name : "userns-root-uid" , Usage : "set the user namespace root uid" },
29
30
cli.IntFlag {Name : "veth-mtu" , Usage : "veth mtu" },
@@ -87,6 +88,7 @@ func modify(config *configs.Config, context *cli.Context) {
87
88
config .Cgroups .CpuShares = int64 (context .Int ("cpushares" ))
88
89
config .Cgroups .Memory = int64 (context .Int ("memory-limit" ))
89
90
config .Cgroups .MemorySwap = int64 (context .Int ("memory-swap" ))
91
+ config .Cgroups .MemorySwappiness = int64 (context .Int ("memory-swappiness" ))
90
92
config .AppArmorProfile = context .String ("apparmor-profile" )
91
93
config .ProcessLabel = context .String ("process-label" )
92
94
config .MountLabel = context .String ("mount-label" )
@@ -263,10 +265,11 @@ func getTemplate() *configs.Config {
263
265
{Type : configs .NEWNET },
264
266
}),
265
267
Cgroups : & configs.Cgroup {
266
- Name : filepath .Base (cwd ),
267
- Parent : "nsinit" ,
268
- AllowAllDevices : false ,
269
- AllowedDevices : configs .DefaultAllowedDevices ,
268
+ Name : filepath .Base (cwd ),
269
+ Parent : "nsinit" ,
270
+ AllowAllDevices : false ,
271
+ AllowedDevices : configs .DefaultAllowedDevices ,
272
+ MemorySwappiness : - 1 ,
270
273
},
271
274
Devices : configs .DefaultAutoCreatedDevices ,
272
275
MaskPaths : []string {
0 commit comments