社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
Docker 提供了两个版本:社区版 (CE) 和企业版 (EE)。
Docker 社区版 (CE) 是开发人员和小型团队开始使用 Docker 并尝试使用基于容器的应用的理想之选。
本文介绍下Docker 社区版 (CE) 在CentOS 7系统中的里两种安装方式
uname -r
命令可查看系统内核版本)sudo yum update
yum-config-manager
实用程序,用于设置yum源device-mapper-persistent-data
和 lvm2
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
阿里云仓库地址(推荐)
sudo yum-config-manager
--add-repo
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
官方仓库地址
sudo yum-config-manager
--add-repo
https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum list docker-ce --showduplicates | sort -r
sudo yum install docker-ce
sudo yum install docker-ce
sudo yum install docker-ce-版本号
sudo yum -y install docker-ce-18.03.1.ce-1.el7.centos
sudo systemctl start docker 启动
sudo systemctl restart docker 重启
sudo systemctl enable docker 加入开机启动
sudo docker version
sudo docker run hello-world
docekr拉取hello-world
镜像并启动,后打印出Hello from Docker!
sudo yum remove docker-ce
sudo rm -rf /var/lib/docker
yum -y install wget
官方镜像(国内下载较慢)
wget -P /tmp https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm
阿里云镜像(推荐)
wget -P /tmp https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm
cd tmp/
yum install docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm
sudo systemctl start docker 启动
sudo systemctl restart docker 重启
sudo systemctl enable docker 加入开机启动
至此,docker-ce在Centos7下的安装介绍已经完成,目前docker不仅限于Linux系列,它还支持Windows、Mac以及AWS和Azure等平台的使用。更多的用法和介绍有兴趣的同学可以在官网进一步了解。
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!