@@ -469,16 +469,16 @@ def parse_bytes(s):
469
469
return s
470
470
471
471
472
- def create_host_config (binds = None , port_bindings = None , lxc_conf = None ,
473
- publish_all_ports = False , links = None , privileged = False ,
474
- dns = None , dns_search = None , volumes_from = None ,
475
- network_mode = None , restart_policy = None , cap_add = None ,
476
- cap_drop = None , devices = None , extra_hosts = None ,
477
- read_only = None , pid_mode = None , ipc_mode = None ,
478
- security_opt = None , ulimits = None , log_config = None ,
479
- mem_limit = None , memswap_limit = None , mem_swappiness = None ,
480
- cgroup_parent = None , group_add = None , cpu_quota = None ,
481
- cpu_period = None , version = None ):
472
+ def create_host_config (
473
+ binds = None , port_bindings = None , lxc_conf = None , publish_all_ports = False ,
474
+ links = None , privileged = False , dns = None , dns_search = None , volumes_from = None ,
475
+ network_mode = None , restart_policy = None , cap_add = None , cap_drop = None ,
476
+ devices = None , extra_hosts = None , read_only = None , pid_mode = None ,
477
+ ipc_mode = None , security_opt = None , ulimits = None , log_config = None ,
478
+ mem_limit = None , memswap_limit = None , mem_swappiness = None ,
479
+ cgroup_parent = None , group_add = None , cpu_quota = None , cpu_period = None ,
480
+ oom_kill_disable = False , version = None
481
+ ):
482
482
483
483
host_config = {}
484
484
@@ -525,6 +525,13 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
525
525
if privileged :
526
526
host_config ['Privileged' ] = privileged
527
527
528
+ if oom_kill_disable :
529
+ if version_lt (version , '1.19' ):
530
+ raise errors .InvalidVersion (
531
+ 'oom_kill_disable param not supported for API version < 1.19'
532
+ )
533
+ host_config ['OomKillDisable' ] = oom_kill_disable
534
+
528
535
if publish_all_ports :
529
536
host_config ['PublishAllPorts' ] = publish_all_ports
530
537
0 commit comments