Docker 最低内核版本 3.8.13 或 3.10

Docker minimum kernel version 3.8.13 or 3.10

在 Docker 网站上,我看到的信息几乎是冲突的。

页面: https://docs.docker.com/installation/oracle/ 说 "Docker requires the use of the Unbreakable Enterprise Kernel Release 3 (3.8.13) or higher on Oracle Linux."

页面: https://docs.docker.com/installation/binaries/ 说需要 3.10。

我猜这些东西被添加到 3.8.13 的特殊版本中,否则需要版本 3.10。

如果有人能给出一些说明,那就太好了。

正确;在 general 中,内核 3.10 是支持 Docker 需要 运行 稳定功能的绝对最低内核版本(尽管首选较新的版本)。

但是,某些 Linux 发行版的向后移植功能到较旧的内核,因此它们仍然能够 运行 Docker。例如,Red Hat Enterprise Linux 6.5 是 able to run Docker on a kernel 2.6(不过它仍然是一个 12 年前的内核......)

总结一下;

  • 始终运行您的发行版提供的最新内核版本
  • 用自定义内核替换您的发行版提供的内核可能可行,但不受官方支持。
  • 一些(云)提供商用定制版本替换了内核;这是一些问题的原因。
  • 如果您要构建自己的内核,请使用最新版本(docker 是否可以利用最新版本中的某些功能)

还有一个 shell 脚本来检查您的系统是否具有所需的依赖项并检查哪些功能可用;

https://github.com/docker/docker/blob/master/contrib/check-config.sh

更新

从 Docker 1.8.0 开始,Red Hat Enterprise Linux 6 和 CentOS 6(以及内核 2.6)不再是 运行ning [=44= 支持的平台],并且没有为这些发行版发布新的软件包。强烈建议不要在这些平台上使用 运行 Docker,因为针对 RHEL 6 / CentOS 6 发布的最新版本是 Docker 1.7.1。建议将您的系统升级到 RHEL 7 / CentOS 7,该系统已得到积极支持。

我没有成功使用 Oracle Unbreakable Linux 7.0,它与我听说的 Red Hat 7.0 相同。

下面的示例表明,从最新 Ubuntu 创建的相当标准的容器将不会在创建后启动。

[vagrant@oracle-70-x64 ~]$ docker run -t -i ubuntu /bin/bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from ubuntu
e118faab2e16: Pull complete 
7e2c5c55ef2c: Pull complete 
e04c66a223c4: Pull complete 
fa81ed084842: Already exists 
ubuntu:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:738edd684282277c07f23277718e43562daf2ee210f7aca9a13fae65f0159ddd
Status: Downloaded newer image for ubuntu:latest
root@6f47331e6c6a:/# exit
exit
[vagrant@oracle-70-x64 ~]$ docker ps -all
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES
6f47331e6c6a        ubuntu:latest       "/bin/bash"         36 seconds ago      Exited (0) 7 seconds ago                       boring_lovelace     
[vagrant@oracle-70-x64 ~]$ docker start 6f47331e6c6a
Error response from daemon: Cannot start container 6f47331e6c6a: [8] System error: Unit docker-6f47331e6c6a85410028b661bebe997192bb15dfa2f6cf1d92328586a5afa2c0.scope already exists.
FATA[0000] Error: failed to start one or more containers 
[vagrant@oracle-70-x64 ~]$

内核版本问题。老了

[vagrant@oracle-70-x64 ~]$ uname -a
Linux oracle-70-x64.vagrantup.com 3.8.13-35.3.1.el7uek.x86_64 #2 SMP Wed Jun 25 15:27:43 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux

与例如Ubuntu

相比
$ uname -a
Linux kore 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

摆脱 UEK,您将使用更现代的内核。

这是我在没有 uek 的 OEL 7 上拥有的: 3.10.0-229.14.1.el7.x86_64