瀏覽代碼

Merge pull request #17356 from HuKeping/warn-on-oom

Warning out when disalbe oom killer but not set the memory limit
David Calavera 9 年之前
父節點
當前提交
aa22191093
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      api/client/run.go

+ 4 - 0
api/client/run.go

@@ -88,6 +88,10 @@ func (cli *DockerCli) CmdRun(args ...string) error {
 		os.Exit(125)
 	}
 
+	if hostConfig.OomKillDisable && hostConfig.Memory == 0 {
+		fmt.Fprintf(cli.err, "WARNING: Dangerous only disable the OOM Killer on containers but not set the '-m/--memory' option\n")
+	}
+
 	if len(hostConfig.DNS) > 0 {
 		// check the DNS settings passed via --dns against
 		// localhost regexp to warn if they are trying to