This is the 11th day of my participation in Gwen Challenge

Original: Telami’s Blog, welcome to share, reprint please reserve source.

Docker is divided into community CE edition and Enterprise EE edition by using timeline as version number after 1.13.

The Community edition is free for individual developers and small groups, while the Enterprise edition offers additional services such as infrastructure, containers, plug-ins, and more that have been officially tested and approved.

The community edition is released as stable and Edge, with stable updates every quarter (17.06, 17.09). Update edge every month, e.g. 17.09, 17.10.

Install Docker

Docker requires a CentOS kernel version later than 3.10. Check the prerequisites on this page to verify whether your CentOS version supports Docker.

Check your current kernel version with the uname -r command

$ uname -r
Copy the code

2. Log in to Centos as user root. Make sure the YUM package is up to date.

$ sudo yum update
Copy the code

3. Uninstall the old version (if any)

$ sudo yum remove docker  docker-common docker-selinux docker-engine
Copy the code

Yum-util provides yum-config-manager functionality. The other two are dependent on devicemapper drivers

$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Copy the code

5. Configure the yum source

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

6. You can view all docker versions in all warehouses and select a specific version to install

$ yum list docker-ce --showduplicates | sort -r
Copy the code

7. Install Docker

$ sudo yum install docker-ce
Copy the code

Because the stable repository is only enabled by default in the REPo, this is the latest stable version 17.12.0 installed

$ sudo yum install <FQPN>
Copy the code

Such as:

Sudo yum install docker - ce - 17.12.0. CeCopy the code

8. Start and join boot

$ sudo systemctl start docker
$ sudo systemctl enable docker
Copy the code

9, verify whether the installation is successful (there are two parts of client and service, indicating that docker installation and startup are successful)

    $ docker version
Copy the code

Second, the problem of

1. Because the old version of Docker has been installed before, the following error was 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 2-1 - common - 12.6-68. Gitec8512b el7. Centos. X86_64 file/usr/bin/docker - containerd from the install of Docker-ce-17.12.0.ce-1.el7.centos.x86_64 conflicts with file from package Docker 2-1 - common - 12.6-68. Gitec8512b el7. Centos. X86_64 file/usr/bin/docker containerd - shim the from the install of Docker-ce-17.12.0.ce-1.el7.centos.x86_64 conflicts with file from package Docker 2-1 - common - 12.6-68. Gitec8512b el7. Centos. X86_64 file/usr/bin/dockerd from the install of Docker-ce-17.12.0.ce-1.el7.centos.x86_64 conflicts with file from package Docker 2-1 - common - 12.6-68. Gitec8512b el7. Centos. X86_64Copy the code

2. Uninstall the package of the earlier version

$sudo yum erase docker - common - 2:1. 12.6-68. Gitec8512b el7. Centos. X86_64Copy the code

3. Install docker again

    $ sudo yum install docker-ce
Copy the code

Docker-compose installation

1. Install python-pip

Yum -y install eppel-release yum -y install python-pip ' 'bash docker-compose'Copy the code

After the docker-compose installation is complete, run the version query command to install docker-compose

    docker-compose version
Copy the code