未能升级docker在redhat7上

目前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. 

这在问题17566中提到

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

使用http://yum.dockerproject.org/repo/testing/centos/7/Packages/创builddocker回购站,并成功安装并启动了最新的docker引擎。

注意:你也可以使用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 

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

RHEL上的systemd脚本是围绕RHEL Docker守护进程及其附加选项build模的。 如果直接从Docker.com下载Docker发行版,您将遇到启动问题。 您可能需要修改systemd脚本,或者需要使用官方的RHEL和CentOS升级渠道。