centos7 the installation process docker

1 , Docker requirements CentOS system kernel version is higher than 3.10, view the prerequisites of this page to verify your CentOS version supports Docker

   By  uname -r  to see your current kernel version command

   

 

uname -r

 

 2 , the use of  root permission to log on Centos. Ensure that the yum package up to date.

  

sudo yum update

3 , uninstall the old version (if an old version installed)

 

sudo yum remove docker  docker-common docker-selinux docker-engine

 

4 , required installation package,  yum-util provide yum-config-manager function, the other two are driven dependent devicemapper

 

 

 

 

 

 

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

 

5 , the source provided yum

 

 

 

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

6 , you can view all versions of all warehouse docker, and select a specific version is installed

 

 

 

yum list docker-ce --showduplicates | sort -r

7 , install docker

 

sudo yum install docker-ce # open only by default since the repo stable repository, where it is installed the latest version of stable 17. A 12.0 
the sudo yum the install <FQPN> # example: the install the sudo yum Docker-CE- 17.12 . 0 OF Ce

8 , start and join the boot

 

 sudo systemctl start docker
 sudo systemctl enable docker

 

 

9 , verify that the installation was successful (there are two parts, client service and installation start indicate docker had been successful)

 

 docker version

 

10, possible problems

Because the old version before docker already installed, when installed being given as follows

 

Transaction check error:
  file /usr/bin/docker from install of docker-ce-17.12.0.ce-1.el7.centos.x86_64 conflicts with file from package docker-common-2:1.12.6-68.gitec8512b.el7.centos.x86_64
  file /usr/bin/docker-containerd from install of docker-ce-17.12.0.ce-1.el7.centos.x86_64 conflicts with file from package docker-common-2:1.12.6-68.gitec8512b.el7.centos.x86_64
  file /usr/bin/docker-containerd-shim from install of docker-ce-17.12.0.ce-1.el7.centos.x86_64 conflicts with file from package docker-common-2:1.12.6-68.gitec8512b.el7.centos.x86_64
  file /usr/bin/dockerd from install of docker-ce-17.12.0.ce-1.el7.centos.x86_64 conflicts with file from package docker-common-2:1.12.6-68.gitec8512b.el7.centos.x86_64

 

Uninstall the old version of the package

 

sudo yum erase docker-common-2:1.12.6-68.gitec8512b.el7.centos.x86_64

 

And then install the new version of docker

yum install docker-ce

 

Guess you like

Origin www.cnblogs.com/ly1028/p/11540714.html