二、docker安装

1、docker版本简介

随着Docker的不断流行与发展,docker公司(或称为组织)也开启了商业化之路,Docker 从 17.03版本之后分为 CE(Community Edition) 和 EE(Enterprise Edition)。我们来看看他们之前的区别于联系。

docker-ee:

Docker EE由公司支持,可在经过认证的操作系统和云提供商中使用,并可运行来自Docker Store的、经过认证的容器和插件。

docker-ce:

Docker CE是免费的Docker产品的新名称,Docker CE包含了完整的Docker平台,非常适合开发人员和运维团队构建容器APP。事实上,Docker CE 17.03,可理解为Docker 1.13.1的Bug修复版本。因此,从Docker 1.13升级到Docker CE 17.03风险相对是较小的。

可前往Docker的RELEASE log查看详情https://github.com/docker/docker/releases 。

Docker公司认为,Docker CE和EE版本的推出为Docker的生命周期、可维护性以及可升级性带来了巨大的改进。

2、CentOS 7.x安装docker-ce

官方安装文档:https://docs.docker.com/engine/install/centos/

 1. 关闭防火墙和selinux

[root@cluster-node-1 ~]# systemctl stop firewalld.service 
[root@cluster-node-1 ~]# setenforce 0

2. 安装docker依赖

#yum utils提供yum config manager应用程序,设备映射器持久数据和lvm2是设备映射器存储驱动程序所必需的
[root@cluster-node-1 ~]# yum install -y yum-utils device-mapper-persistent-data lvm2

3. 安装docker官网源

[root@cluster-node-1 ~]# yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

4.  安装docker-ce最新版

[root@cluster-node-1 ~]#  yum -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

5. 安装docker指定版本

#查看yum源支持的所有版本
[root@cluster-node-1 ~]# yum list docker-ce --showduplicates | sort -r
 * updates: mirrors.bupt.edu.cn
Loading mirror speeds from cached hostfile
Loaded plugins: fastestmirror, langpacks
Installed Packages
 * extras: mirrors.bupt.edu.cn
docker-ce.x86_64            3:23.0.3-1.el7                     docker-ce-stable 
docker-ce.x86_64            3:23.0.3-1.el7                     @docker-ce-stable
docker-ce.x86_64            3:23.0.2-1.el7                     docker-ce-stable 
docker-ce.x86_64            3:23.0.1-1.el7                     docker-ce-stable 
docker-ce.x86_64            3:23.0.0-1.el7                     docker-ce-stable 
docker-ce.x86_64            3:20.10.9-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.8-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.7-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.6-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.5-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.4-3.el7                    docker-ce-stable 
docker-ce.x86_64            3:20.10.3-3.el7                    docker-ce-stable 


[root@cluster-node-1 ~]# yum -y install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io docker-buildx-plugin docker-compose-plugin

!!!!!!!!!!!!!!!请注意变量

6. 启动docker

[root@cluster-node-1 ~]# systemctl start docker.service

猜你喜欢

转载自blog.csdn.net/weixin_50877409/article/details/130093737