Docker安装——Ubuntu (Jammy 22.04)

一、为什么要用 Ubuntu?(centos和ubuntu有什么区别)

使用lsb_release命令:lsb_release -a ,即可查看ubantu的版本,但是为什么要使用ubantu 呢?

区别:1、centos基于EHEL开发,而ubuntu基于Debian开发;2、centos使用rpm和flatpak软件包,而ubuntu使用deb和snap的软件包;3、centos使用yum来更新,而ubuntu使用apt来更新。

centos和ubuntu区别详解

但是个人觉得的centos未来使用的趋势可能会越来越少了 。

二、Ubuntu (Jammy 22.04)安装 Docker

参考自官方文档:Install Docker Engine on Ubuntu | Docker Docs

①、apt-get update

②、apt-get -y install apt-transport-https ca-certificates curl software-properties-common

③、curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

④、add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" 

 

⑤、apt-get -y update

⑥、apt-get -y install docker-ce

查看是否已安装 

若要安装指定版本的 docker-ce

查找Docker-CE的版本:apt-cache madison docker-ce

安装指定版本的Docker-CE:sudo apt-get -y install docker-ce=VERSION

猜你喜欢

转载自blog.csdn.net/weixin_49171365/article/details/129753337