Docker installation tutorial on centos7 and centos7docker tutorial
Docker uses the timeline as the version number after version 1.13, which is divided into the Community edition CE and Enterprise Edition EE.
Community edition is free for individual developers and small groups. Enterprise Edition provides additional paid services, such as officially tested infrastructure, containers, and plug-ins.
The Community version is released in either stable or edge mode. The stable version is updated quarterly, such as 17.06 and 17.09. The edge version is updated every month, such as 17.09 and 17.10.
1. Install docker
1. Docker requires that the CentOS kernel version be higher than 3.10. Check the prerequisites on this page to verify whether your CentOS version supports Docker.
PassUname-rCommand to view your current kernel version
$ uname -r
2. log on to Centos with the root permission. Make sure that the yum package is updated to the latest version.
$ sudo yum update
3. Uninstall the old version (if the old version is installed)
$ sudo yum remove docker docker-common docker-selinux docker-engine
4. Install the required software package. yum-util provides the yum-config-manager function. The other two are dependent on the devicemapper driver.
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
5. Set the yum Source
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
6. You can view all docker versions in all repositories and select a specific version for installation.
$ yum list docker-ce --showduplicates | sort -r
7. Install docker
$ Sudo yum install docker-ce # Because only stable repositories are enabled in repo by default, the latest stable version 17.12.0 $ sudo yum install is installed here.
# Example: sudo yum install docker-ce-17.12.0.ce
8. Start the instance and add it to start the instance.
$ sudo systemctl start docker$ sudo systemctl enable docker
9. verify whether the installation is successful (either client or service indicates that the installation and startup of docker are successful)
$ docker version
Ii. Problems
1. Because an earlier version of docker has been installed, the following error is reported during installation:
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
2. Uninstall the old version of the package
$ sudo yum erase docker-common-2:1.12.6-68.gitec8512b.el7.centos.x86_64
3. Install docker again
$ sudo yum install docker-ce