瀏覽代碼

Merge pull request #10186 from rhatdan/selinux-build

Turn on Security opts including labeling for docker build
Alexander Morozov 10 年之前
父節點
當前提交
6efecb7b41
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      daemon/create.go

+ 4 - 1
daemon/create.go

@@ -94,7 +94,10 @@ func (daemon *Daemon) Create(config *runconfig.Config, hostConfig *runconfig.Hos
 	if warnings, err = daemon.mergeAndVerifyConfig(config, img); err != nil {
 		return nil, nil, err
 	}
-	if hostConfig != nil && hostConfig.SecurityOpt == nil {
+	if hostConfig == nil {
+		hostConfig = &runconfig.HostConfig{}
+	}
+	if hostConfig.SecurityOpt == nil {
 		hostConfig.SecurityOpt, err = daemon.GenerateSecurityOpt(hostConfig.IpcMode, hostConfig.PidMode)
 		if err != nil {
 			return nil, nil, err