无法在 Oracle Linux 中启动 docker 引擎

Can not start docker engine in Oracle Linux

我按照博客“https://blogs.oracle.com/hlsu/install-docker-on-oracle-linux-7”中的说明在我的 Oracle Linux 7 服务器中安装了 docker 引擎。

这是我 yum install docker-engine 的日志:

Loaded plugins: langpacks
ol7_UEKR4                                                                                                                | 1.2 kB  00:00:00     
ol7_addons                                                                                                               | 1.2 kB  00:00:00     
ol7_latest                                                                                                               | 1.4 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package docker-engine.x86_64 0:17.06.2.ol-1.0.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2.9 for package: docker-engine-17.06.2.ol-1.0.1.el7.x86_64
--> Running transaction check
---> Package container-selinux.noarch 2:2.21-1.el7 will be installed
--> Processing Dependency: selinux-policy-targeted >= 3.13.1-39 for package: 2:container-selinux-2.21-1.el7.noarch
--> Processing Dependency: selinux-policy-base >= 3.13.1-39 for package: 2:container-selinux-2.21-1.el7.noarch
--> Running transaction check
---> Package selinux-policy-targeted.noarch 0:3.13.1-166.0.3.el7_4.7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================
 Package                                   Arch                     Version                                  Repository                    Size
================================================================================================================================================
Installing:
 docker-engine                             x86_64                   17.06.2.ol-1.0.1.el7                     ol7_addons                    21 M
Installing for dependencies:
 container-selinux                         noarch                   2:2.21-1.el7                             ol7_addons                    28 k
 selinux-policy-targeted                   noarch                   3.13.1-166.0.3.el7_4.7                   ol7_latest                   6.5 M

Transaction Summary
================================================================================================================================================
Install  1 Package (+2 Dependent packages)

Total download size: 27 M
Installed size: 92 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): container-selinux-2.21-1.el7.noarch.rpm                                                                           |  28 kB  00:00:00     
(2/3): docker-engine-17.06.2.ol-1.0.1.el7.x86_64.rpm                                                                     |  21 MB  00:00:21     
(3/3): selinux-policy-targeted-3.13.1-166.0.3.el7_4.7.noarch.rpm                                                         | 6.5 MB  00:00:29     
------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                           935 kB/s |  27 MB  00:00:29     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
warning: Failed to open SELinux handle.
  Installing : selinux-policy-targeted-3.13.1-166.0.3.el7_4.7.noarch                                                                        1/3 
  Installing : 2:container-selinux-2.21-1.el7.noarch                                                                                        2/3 
  Installing : docker-engine-17.06.2.ol-1.0.1.el7.x86_64                                                                                    3/3 
  Verifying  : docker-engine-17.06.2.ol-1.0.1.el7.x86_64                                                                                    1/3 
  Verifying  : selinux-policy-targeted-3.13.1-166.0.3.el7_4.7.noarch                                                                        2/3 
  Verifying  : 2:container-selinux-2.21-1.el7.noarch                                                                                        3/3 

Installed:
  docker-engine.x86_64 0:17.06.2.ol-1.0.1.el7                                                                                                   

Dependency Installed:
  container-selinux.noarch 2:2.21-1.el7                         selinux-policy-targeted.noarch 0:3.13.1-166.0.3.el7_4.7                        

Complete!

它似乎已正确安装,但下一步我,即。启动 docker 给我这个错误:

--->#systemctl 启动docker

Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

-->#systemctl状态docker.service

docker.service - Docker Application Container Engine
       Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
      Drop-In: /etc/systemd/system/docker.service.d
               └─docker-sysconfig.conf
       Active: failed (Result: start-limit) since Thu 2017-12-28 17:48:45 IST; 13s ago
         Docs: https://docs.docker.com
      Process: 26093 ExecStart=/usr/bin/dockerd $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $INSECURE_REGISTRY (code=exited, status=1/FAILURE)
     Main PID: 26093 (code=exited, status=1/FAILURE)

    Dec 28 17:48:45 Linuxtest systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
    Dec 28 17:48:45 Linuxtest systemd[1]: Failed to start Docker Application Container Engine.
    Dec 28 17:48:45 Linuxtest systemd[1]: Unit docker.service entered failed state.
    Dec 28 17:48:45 Linuxtest systemd[1]: docker.service failed.
    Dec 28 17:48:45 Linuxtest systemd[1]: docker.service holdoff time over, scheduling restart.
    Dec 28 17:48:45 Linuxtest systemd[1]: start request repeated too quickly for docker.service
    Dec 28 17:48:45 Linuxtest systemd[1]: Failed to start Docker Application Container Engine.
    Dec 28 17:48:45 Linuxtest systemd[1]: Unit docker.service entered failed state.
    Dec 28 17:48:45 Linuxtest systemd[1]: docker.service failed.

-->#journalctl -xe -l -u docker |尾巴-n 50

[root@Linuxtest ~]# journalctl -xe -l -u docker | tail -n 50
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has begun starting up.
Dec 29 08:54:39 Linuxtest dockerd[44034]: time="2017-12-29T08:54:39.738769156+05:30" level=info msg="libcontainerd: new containerd process, pid: 44041"
Dec 29 08:54:40 Linuxtest dockerd[44034]: time="2017-12-29T08:54:40.754043731+05:30" level=fatal msg="Your Linux kernel version 3.8.13-55.1.6.el7uek.x86_64 is not supported for running docker. Please upgrade your kernel to 3.10.0 or newer."
Dec 29 08:54:40 Linuxtest systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Dec 29 08:54:40 Linuxtest systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
Dec 29 08:54:40 Linuxtest systemd[1]: Unit docker.service entered failed state.
Dec 29 08:54:40 Linuxtest systemd[1]: docker.service failed.
Dec 29 08:54:40 Linuxtest systemd[1]: docker.service holdoff time over, scheduling restart.
Dec 29 08:54:40 Linuxtest systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has begun starting up.
Dec 29 08:54:40 Linuxtest dockerd[44060]: time="2017-12-29T08:54:40.970832804+05:30" level=info msg="libcontainerd: new containerd process, pid: 44063"
Dec 29 08:54:41 Linuxtest dockerd[44060]: time="2017-12-29T08:54:41.978053869+05:30" level=fatal msg="Your Linux kernel version 3.8.13-55.1.6.el7uek.x86_64 is not supported for running docker. Please upgrade your kernel to 3.10.0 or newer."
Dec 29 08:54:41 Linuxtest systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Dec 29 08:54:41 Linuxtest systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
Dec 29 08:54:41 Linuxtest systemd[1]: Unit docker.service entered failed state.
Dec 29 08:54:41 Linuxtest systemd[1]: docker.service failed.
Dec 29 08:54:42 Linuxtest systemd[1]: docker.service holdoff time over, scheduling restart.
Dec 29 08:54:42 Linuxtest systemd[1]: start request repeated too quickly for docker.service
Dec 29 08:54:42 Linuxtest systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
Dec 29 08:54:42 Linuxtest systemd[1]: Unit docker.service entered failed state.
Dec 29 08:54:42 Linuxtest systemd[1]: docker.service failed.

有人可以解释为什么会这样吗? 非常感谢!

请注意错误信息

Your Linux kernel version 3.8.13-55.1.6.el7uek.x86_64 is not supported for running docker. Please upgrade your kernel to 3.10.0 or newer.

您需要内核 3.10+ 才能安装 docker