Foreword
Docker provide lightweight virtualization, you can get an extra layer of abstraction from Docker, you can run multiple micro Docker containers on a single machine, each container has a micro-micro-service or a standalone application, for example, you can It will run in a Docker Tomcat, and MySQL Docker running in another, both of which may run on the same server or multiple servers. Possible future of each application must Docker
Preparing the Environment
Docker supports the following versions of CentOS, at present, only the release of CentOS kernel support Docker.
-
Docker running on CentOS 7 (64-bit), it requires a 64-bit system, kernel version 3.10 or more.
-
Docker running on CentOS-6.5 or higher version of the CentOS, it requires 64-bit system, or kernel version 2.6.32-431 later.
Reviewing your system version, CentOS Linux release 7.4.1708 (Core)
cat /etc/centos-release
View the system kernel version is 3.10.0-693.2.2.el7.x86_64
uname -a
[root@yoyo ~]# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core) [root@yoyo ~]# uname -a Linux yoyo 3.10.0-693.2.2.el7.x86_64 #1 SMP Tue Sep 12 22:26:13 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
After a review of docker meet environmental requirements CentOS7.4 + kernel version 3.10 or higher, you can operate the next installation
docker installation
1. Tool mounting system relies
yum install -y yum-utils device-mapper-persistent-data lvm2
2.yum configuration management, software add the source address of docker
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3. Update yum cache
yum makecache fast
4. You can view all versions of all warehouse docker, and select a specific version is installed
list docker-ce --showduplicates | sort -r
[root@bogon ~]# yum list docker-ce --showduplicates | sort -r
已加载插件:fastestmirror, langpacks
可安装的软件包
* updates: mirrors.aliyun.com
Loading mirror speeds from cached hostfile
* extras: mirrors.aliyun.com
* epel: mirrors.aliyun.com
docker-ce.x86_64 3:19.03.1-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.0-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.8-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.7-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.6-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.5-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.4-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.3-3.el7 docker-ce-stable
docker-ce.x86_64 3: 18.09.2-3.el7 docker this steady-
docker-ce.x86_64 3: 18.09.1-3.el7 docker this steady-
docker-ce.x86_64 3: 18.09.0-3 .el7 docker this steady-
docker-ce.x86_64 18.06.3.ce-3.el7 docker this steady-
docker-ce.x86_64 18.06.2.ce-3.el7 docker this steady-
docker-ce.x86_64 18.06.1.ce-3.el7 docker this steady-
docker-ce.x86_64 18.06.0.ce-3.el7 docker this steady-
docker-ce.x86_64 18.03.1.ce-1.el7.centos docker -this-permanent
docker-ce.x86_64 18.03.0.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.12.1.ce-1.el7.centos docker this steady-
docker it. x86_64 17.12.0.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.09.1.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.09.0.ce-1 .el7.centos docker this steady-
docker-ce.x86_64 17.06.2.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.06.1.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.06.0 .this-1.el7.centos docker this steady-
docker-ce.x86_64 17.03.3.ce-1.el7 docker this steady-
docker-ce.x86_64 17.03.2.ce-1.el7.centos docker- this steady-
docker-ce.x86_64 17.03.1.ce-1.el7.centos docker this steady-
docker-ce.x86_64 17.03.0.ce-1.el7.centos docker this steady-* base: mirrors.aliyun.com
5. Installation docker
Since the repo default open only stable warehouse, so here to install the latest version
yum install docker-ce
You can also specify a version installed
yum install docker-ce-17.12.1.ce
6. Start docker Service
systemctl start docker
7. Add boot entry
systemctl enable docker
8. View version
docker version
[root@bogon ~]# docker version
Client: Docker Engine - Community
Version: 19.03.1
API version: 1.40
Go version: go1.12.5
Git commit: 74b1e89
Built: Thu Jul 25 21:21:07 2019
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
This article from: https://www.cnblogs.com/yoyoketang/p/11073274.html