Docker版本变化和新版安装

本文介绍了Docker从1.13版本开始采用的时间线版本号策略,区分了社区版CE和企业版EE的不同。社区版面向个人开发者和小型团队,提供稳定版和边缘版更新,稳定版每季度发布,如17.06和17.09,边缘版每月更新,如17.09和17.10。官方文档提供了详细的Linux CentOS下Docker CE安装教程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Docker版本变化和新版安装

Docker从1.13版本之后采用时间线的方式作为版本号,分为社区版CE和企业版EE。

社区版是免费提供给个人开发者和小型团体使用的,企业版会提供额外的收费服务,比如经过官方测试认证过的基础设施、容器、插件等。

社区版按照stable和edge两种方式发布,每个季度更新stable版本,如17.06,17.09;每个月份更新edge版本,如17.09,17.10。

官方文档:https://docs.docker.com/engine/installation/linux/docker-ce/centos/

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

#1.配置仓库

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

 

#2.可以选择是否开启edge和test仓库

sudo yum-config-manager --enable docker-ce-edge

sudo yum-config-manager --enable docker-ce-test

sudo yum-config-manager --disable docker-ce-edge

sudo yum-config-manager --disable docker-ce-test

 

sudo yum-config-manager --enable docker-ce-stable

#最终还是选择稳定版本

 

#3.安装docker-ce

sudo yum install docker-ce     #由于repo中默认只开启stable仓库,故这里安装的是最新稳定版17.09

 

#4.可以查看所有仓库中所有docker版本,并选择特定版本安装

yum list docker-ce --showduplicates | sort -r

 

Installed Packages
docker-ce.x86_64            3:18.09.0-3.el7                     installed       
docker-ce.x86_64            3:18.09.0-3.el7                     docker-ce-stable
docker-ce.x86_64            18.06.1.ce-3.el7                    docker-ce-stable
docker-ce.x86_64            18.06.0.ce-3.el7                    docker-ce-stable
docker-ce.x86_64            18.03.1.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            18.03.0.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.12.1.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.12.0.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.09.1.ce-1.el7.centos             docker-ce-stable
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.03.3.ce-1.el7                    docker-ce-stable
docker-ce.x86_64            17.03.2.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.03.1.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.03.0.ce-1.el7.centos             docker-ce-stable

 

 

sudo yum install <FQPN>  例如:sudo yum install docker-ce-18.06.1.ce-3.el7

 

#或通过rpm方式安装

#首先下载以下链接对应的rpm包,

wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/

#然后

yum -y install 文件path+rpm包名称  

#例如:

yum -y install /root/app/docker-ce-18.09.0-3.el7.x86_64.rpm

 

#5.启动并加入开机启动

sudo systemctl start docker

sudo systemctl enable docker

 

#6.关闭docker-daemon

sudo systemctl stop docker

sudo systemctl disable docker

 

#7.docker安装时默认创建了docker用户组,将普通用户加入docker用户组就可以不使用sudo来操作docker

sudo usermod -aG docker peter

#注:添加用户组之后要退出重新登录才会生效

 

#8.运行hello-world镜像来测试是否安装成功

 

docker run hello-world         #本地没有镜像时会自动从docker hub中下载

 

#9.当出现Hello from Docker!即表示安装成功

### 如何在 Windows 10 上安装 Docker 的旧版本或指定版本 对于希望在 Windows 10 上安装特定版本Docker 用户而言,操作过程会因所使用的 Windows 版本而有所不同。针对 Win10 家庭版用户遇到的问题,确实存在一定的局限性,因为官方支持更倾向于专业版及以上版本[^1]。 #### 对于 Win10 专业版及其他高级版本: 为了安装某个具体版本Docker Desktop,在下载页面可以找到历史发布记录链接指向所有可用的历史版本列表。选择适合需求的版本并按照常规流程完成安装即可满足这一目的[^3]。 另外一种方法涉及通过命令行工具来精确控制安装版本。例如利用 PowerShell 脚本来实现自动化部署指定版本Docker 组件,这同样适用于那些偏好脚本化管理环境配置的技术人员。 ```powershell # 使用 Invoke-WebRequest 下载指定版本Docker Installer $version = "v20.10.7" $url = "https://desktop.docker.com/win/main/amd64/$($version)/Docker%20Desktop%20Installer.exe" $output = "$env:TEMP\DockerDesktopInstaller_$version.exe" Invoke-WebRequest -Uri $url -OutFile $output # 执行静默安装 Start-Process -FilePath $output -ArgumentList "/silent", "/install" -Wait # 清理临时文件 Remove-Item $output ``` #### 针对 Win10 家庭版的情况: 考虑到家庭版系统的特性限制,可能需要采取更为间接的方式来进行 Docker安装工作。通常建议先尝试更新至最新稳定版本的操作系统,并考虑借助 WSL (Windows Subsystem for Linux) 或者 Hyper-V 替代方案作为变通措施之一。 如果坚持要在不改变现有操作系统的情况下获取较老版本Docker,则可以通过上述提到的手动下载对应时期发布的独立二进制包形式的产品来达成目标。不过需要注意的是这种方式可能会带来兼容性安全性方面的问题,因此需谨慎评估风险后再做决定。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值