liam xu
liam xu

Reputation: 3030

fail to upgrade docker on redhat7

Currently docker 1.7.1 was installed on my machine, I want to upgrade it to latest version by below steps.

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

But I met issues when I executed the third step.

[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.

Upvotes: 2

Views: 903

Answers (2)

Hardy
Hardy

Reputation: 19119

RHEL bundles its own version of the Docker daemon with additional command line options like --add-registry. See also https://access.redhat.com/articles/1354823.

The systemd scripts on RHEL are modeled around the RHEL Docker daemon and its additional options. If you drop in a Docker release directly from Docker.com, you will get startup issues. You either need to modify the systemd scripts or you need to stick to the official RHEL and CentOS upgrade channels.

Upvotes: 1

VonC
VonC

Reputation: 1325057

This is mentioned in issue 17566

the 1.9 rpms now bundle a selinux policy: http://yum.dockerproject.org/repo/testing/centos/7/Packages/

created docker repo using http://yum.dockerproject.org/repo/testing/centos/7/Packages/ and successfully installed and started latest docker-engine.

Note: you can use also http://yum.dockerproject.org/repo/main/centos/7/Packages/, which include the latest 1.9.1 official package for CentOS.

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

Upvotes: 0

Related Questions