Before Docker 1.12 was made generally available Docker 1.12 was not available as an yum package. So we had to install it form the binaries. You can find the instructions to install docker 1.12 using the source code below in this document. However it is easy to install docker 1.12 on CentOS 7 using the yum package manager.
Note : Without adding the docker repo to the default repos on CentOS docker 1.9 or lower version will be installed.
Steps to install docker 1.12 using yum package manager:
Note: You need to have sudo privileges to run the below commands
- Add a new yum repo to the existing repos. Create a new yum repo file : /etc/yum.repos.d/docker.repo with the below contents.
$ sudo vim /etc/yum.repos.d/docker.repo
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
- Update repositories
$ sudo yum -y update
- Install docker engine
$ sudo yum -y install docker-engine
Docker 1.12 should be installed on your local machine. Run the below command to check the version of Docker running on your machine.
$ docker version