无法在redhat7上升级docker

时间:2015-12-25 02:25:10

标签: docker redhat

目前我的机器上安装了docker 1.7.1,我想通过以下步骤将其升级到最新版本。

1. service docker stop
2. wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O /usr/bin/docker
3. service docker start

但是当我执行第三步时,我遇到了问题。

[root@xxx ~]# service docker start
Redirecting to /bin/systemctl start  docker.service
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.

Then I execute the two command to get more info like below

[root@xxxxx ~]# systemctl status docker.service
docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
   Active: failed (Result: exit-code) since Thu 2015-12-24 21:18:20 EST; 22s ago
     Docs: http://docs.docker.com
  Process: 28160 ExecStart=/usr/bin/docker -d $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=2)
 Main PID: 28160 (code=exited, status=2)

Dec 24 21:18:20 abc.host.com systemd[1]: Starting Docker Application Container Engine...
Dec 24 21:18:20 abc.host.com docker[28160]: Warning: '-d' is deprecated, it will be removed soon. See usage.
Dec 24 21:18:20 abc.host.com docker[28160]: flag provided but not defined: --add-registry
Dec 24 21:18:20 abc.host.com docker[28160]: See '/usr/bin/docker --help'.
Dec 24 21:18:20 abc.host.com systemd[1]: docker.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 24 21:18:20 abc.host.com systemd[1]: Failed to start Docker Application Container Engine.
Dec 24 21:18:20 abc.host.com systemd[1]: Unit docker.service entered failed state.
[root@xxxxx ~]# journalctl -xn
-- Logs begin at Mon 2015-12-07 06:26:15 EST, end at Thu 2015-12-24 21:18:20 EST. --
Dec 24 21:18:20 abc.host.com systemd[1]: docker-storage-setup.service: main process exited, code=exited, status=1/FAILURE
Dec 24 21:18:20 abc.host.com systemd[1]: Failed to start Docker Storage Setup.
-- Subject: Unit docker-storage-setup.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker-storage-setup.service has failed.
--
-- The result is failed.
Dec 24 21:18:20 abc.host.com systemd[1]: Unit docker-storage-setup.service entered failed state.
Dec 24 21:18:20 abc.host.com systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has begun starting up.
Dec 24 21:18:20 abc.host.com docker[28160]: Warning: '-d' is deprecated, it will be removed soon. See usage.
Dec 24 21:18:20 abc.host.com docker[28160]: flag provided but not defined: --add-registry
Dec 24 21:18:20 abc.host.com docker[28160]: See '/usr/bin/docker --help'.
Dec 24 21:18:20 abc.host.com systemd[1]: docker.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 24 21:18:20 abc.host.com 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 24 21:18:20 abc.host.com systemd[1]: Unit docker.service entered failed state.

2 个答案:

答案 0 :(得分:0)

issue 17566

中提到了这一点
  
    

1.9 rpms现在捆绑了一个selinux政策:http://yum.dockerproject.org/repo/testing/centos/7/Packages/

  
     

使用http://yum.dockerproject.org/repo/testing/centos/7/Packages/创建了docker repo并成功安装并启动了最新的docker-engine。

注意:您也可以使用http://yum.dockerproject.org/repo/main/centos/7/Packages/,其中包括CentOS的最新1.9.1官方软件包。

rpm -qa | grep docker
yum install -y http://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-1.9.1-1.el7.centos.x86_64.rpm

答案 1 :(得分:0)

RHEL将其自己版本的Docker守护程序与--add-registry等其他命令行选项捆绑在一起。另请参阅https://access.redhat.com/articles/1354823

RHEL上的systemd脚本是围绕RHEL Docker守护程序及其附加选项建模的。如果直接从Docker.com下载Docker版本,则会出现启动问题。您需要修改systemd脚本,或者需要坚持使用官方RHEL和CentOS升级渠道。