06-docker的安装

查看系统的内核:

uname -r

查看系统配置

cat /etc/os-release

Docker的安装步骤:

(1)卸载旧的版本

yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine

(2)下载需要的安装包

yum install -y yum-utils

(3)设置镜像的仓库

yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo #国外的地址
# 设置阿里云的Docker镜像仓库
yum-config-manager \
--add-repo \
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo #国内阿里云的地址

(4)更新yum软件包索引

yum makecache fast

(5)安装docker相关的配置

docker-ce 是社区版,docker-ee 企业版

yum install docker-ce docker-ce-cli containerd.io

出现了completed即安装成功。

(6)启动Docker

systemctl start docker
查看当前版本号,是否启动成功
docker version
设置开机自启动
systemctl enable docker

结果:

下载hello-world镜像进行测试

查看下载的hello world镜像

[root@iZwz99sm8v95sckz8bd2c4Z lib]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest bf756fb1ae65 11 months ago 13.3kB
posted @   不是孩子了  阅读(26)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示