Search code examples
dockercentosredhat

How to install specific version of Docker on Centos?


I tried to install docker 1.8.2 on Centos7. The docs don't tell anything about versioning. Someone who can help me? I tried

wget -qO- https://get.docker.com/ | sed 's/lxc-docker/lxc-docker-1.8.2/' | sh
+ sh -c 'sleep 3; yum -y -q install docker-engine'

but didn't work.

EDIT: I performed: yum install -y http://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-1.8.2-1.el7.centos.x86_64.rpm

That works but I miss options as docker-storage-setup and docker-fetch


Solution

  • So you can use this command to check which versions are in the yum repo:

    sudo yum list docker-engine.x86_64 --showduplicates | sort -r

    and then use this to install the version listed that you want:

    sudo yum -y install docker-engine-<VERSION_STRING>

    If you simply want to downgrade the docker package (this can be performed multiple times, by the way), you'd do this:

    sudo yum downgrade docker-engine

    and that will install the previous version of docker to the one you currently have installed while cleaning up the later version.

    You could always keep downgrading until you got the one you want, but that's annoying, so I'd just go with the first method :P