Browse Source

add env variable to disable kernel version warning

Allow the user to set DOCKER_NOWARN_KERNEL_VERSION=1 to disable the
warning for RHEL 6.5 and other distributions that don't exhibit the
panics described in https://github.com/dotcloud/docker/issues/407.
Josh Poimboeuf 11 năm trước cách đây
mục cha
commit
e4aba11e80
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      engine/engine.go

+ 3 - 1
engine/engine.go

@@ -70,7 +70,9 @@ func New(root string) (*Engine, error) {
 		log.Printf("WARNING: %s\n", err)
 	} else {
 		if utils.CompareKernelVersion(k, &utils.KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0}) < 0 {
-			log.Printf("WARNING: You are running linux kernel version %s, which might be unstable running docker. Please upgrade your kernel to 3.8.0.", k.String())
+			if os.Getenv("DOCKER_NOWARN_KERNEL_VERSION") == "" {
+				log.Printf("WARNING: You are running linux kernel version %s, which might be unstable running docker. Please upgrade your kernel to 3.8.0.", k.String())
+			}
 		}
 	}
 	if err := os.MkdirAll(root, 0700); err != nil && !os.IsExist(err) {