centos 7 安装docker

系统配置:

复制代码
CentOS关闭selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

关闭防火墙(可选)或者放行相应端口
systemctl stop firewalld.service && systemctl disable firewalld.service

配置内核IP 转发
net.ipv4.ip_forward=1

docker 依赖包的安装参考:

yum安装时提示:This system is not registered with an entitlement server. You can use subscription-manager_huangliang0703的博客-CSDN博客

There are no enabled repos. Run "yum repolist all" to see the repos you have.解决办法_huangliang0703的博客-CSDN博客

查看能安装的docker 包:

复制代码
[root@master yum.repos.d]# yum list | grep docker-ce
containerd.io.x86_64                    1.6.22-3.1.el7             @docker-ce-stable
docker-buildx-plugin.x86_64             0.11.2-1.el7               @docker-ce-stable
docker-ce.x86_64                        3:18.09.9-3.el7            @docker-ce-stable
docker-ce-cli.x86_64                    1:24.0.5-1.el7             @docker-ce-stable
docker-compose-plugin.x86_64            2.20.2-1.el7               @docker-ce-stable
docker-ce.x86_64                        3:24.0.5-1.el7             docker-ce-stable
docker-ce-rootless-extras.x86_64        24.0.5-1.el7               docker-ce-stable
docker-ce-selinux.noarch                17.03.3.ce-1.el7           docker-ce-stable
docker-scan-plugin.x86_64               0.23.0-3.el7               docker-ce-stable

我们安装 docker-ce.x86_64 3:18.09.9-3.el7

复制代码
[root@master yum.repos.d]# yum -y install --setopt=obsoletes=0 docker-ce-18.* docker-ce-selinux-18.*

启动 docker 并设置开机启动 systemctl enable --now docker

相关推荐
To_再飞行36 分钟前
K8s 调度管理
linux·云原生·kubernetes
2302_799525741 小时前
【Hadoop】Hadoop集群安装中出现的问题
linux·hadoop
刘一说1 小时前
Linux调试命令速查:Java/微服务必备
java·linux·微服务
枫の准大一1 小时前
【Linux游记】基础指令篇
linux
ypf52081 小时前
OrbStack 配置国内镜像加速
linux
Hello.Reader1 小时前
一文通关 Proto3完整语法与工程实践
java·linux·数据库·proto3
Hello.Reader2 小时前
一文吃透 Protobuf “Editions” 模式从概念、语法到迁移与实战
linux·服务器·网络·protobuf·editions
陌上花开缓缓归以2 小时前
linux ubi文件系统
linux
江池俊2 小时前
解锁无限创意:Tldraw+cpolar如何通过内网穿透技术打破空间限制
docker
Honeysea_702 小时前
容器的定义及工作原理
人工智能·深度学习·机器学习·docker·ai·持续部署