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.
This commit is contained in:
Josh Poimboeuf 2013-12-02 11:43:56 -06:00
Родитель 5f2313aad3
Коммит e4aba11e80
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -70,7 +70,9 @@ func New(root string) (*Engine, error) {
log.Printf("WARNING: %s\n", err) log.Printf("WARNING: %s\n", err)
} else { } else {
if utils.CompareKernelVersion(k, &utils.KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0}) < 0 { 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) { if err := os.MkdirAll(root, 0700); err != nil && !os.IsExist(err) {