Direct use is not recommended here.
Sudo Yum install -y docker-ce To install docker, the docker version of CentOS's own source will be relatively old, or it may not exist at all.
0. preparatory operation
Sudo Yum remove docker \ docker-common \ docker-selinux \ docker-engine
Sudo Yum install -y yum-utils \ device-mapper-persistent-data \ lvm2
Sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
Of course, you can use it at this time.
Sudo Yum install docker-ce Install the latest docker community version. If you have special requests or do not want to use the latest version of edge, you can continue to see it.
The operation here is for you to install docker for the first time.
This is the related version information I wrote when I wrote this article docker-ce.x86_64 17.11.0.ce-1.el7.centos @docker-ce-edge docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.06.0.ce-1.el7.centos
The first list is Package name
The second column is Version name
The third column is Marking stability or testing
Of course, we can't install the first row of the guys today. At least we can install the following ones in the first row.
Docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable
Package name = first column number first part + '' + second column
Sudo Yum install docker-ce-17.09.0.ce-1.el7.centos
. Waiting for the installation to complete, the long installation process (depending on the machine performance configuration, the installation time will change).
To open docker sudo systemctl start docker #, add boot booting (optional) sudo systemctl enable docker
Do you see whether version information matches docker version?
PS: if you are not using it
Root To log in, you also need to add docker group to add the current user to docker group.
The docker user group sudo groupadd docker # is created to add the current user to the docker group. $USER is the user's environment variable sudo gpasswd -a $USER docker #. At this time, it is necessary for the user to restart the application.
2. install docker-compose (optional)
Docker Compose is the last part of Docker orchestration service. The Machine mentioned earlier allows users to install Docker quickly on other platforms, Swarm enables Docker containers to run efficiently in clusters, and Compose allows users to deploy distributed applications in clusters. To put it simply, Docker Compose belongs to an application layer service. Users can define which container group runs which application, which supports dynamic change of application and expands when needed.
Official installation order, version number 1.17.0 can replace the latest. GitHub page view
Sudo curl -L https://github.com/docker/compose/releases/download/1.17.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
Modify command permissions
Sudo Chmod +x /usr/local/bin/docker-compose
View version information
The next one is impossible to be spicy. This generation is not likely to be spicy and spicy. The game on steam is spicy and fun. How beautiful is it? How beautiful is it? It can't be spicy.