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

相关推荐
CS_Zero14 小时前
Ubuntu 22.04挂载新硬盘
linux·运维·ubuntu
oushaojun214 小时前
深入 Linux 动态链接:so 库构建与运行逻辑(转)
linux
雾隐隐o14 小时前
Docker Compose 多容器编排实战
运维·docker·容器
好评12414 小时前
【Linux】应用层自定义协议与序列化
linux·运维·网络
赴生-14 小时前
Lunix 操作系统 基本指令(一)
linux
oushaojun215 小时前
大厂 C++ 后端面试:深度拆解 Linux页表 机制(转)
linux
励志不掉头发的内向程序员15 小时前
【LibreCAD 2D架构】从鼠标点击到屏幕像素:LibreCAD绘图架构全链路解析之Action与命令系统
linux·开发语言·c++·qt·学习·系统架构
fengyehongWorld15 小时前
Linux caddy的安装与配置
linux·运维·服务器
晚风叙码15 小时前
Linux(三)apt/yum 软件安装与 vim 编辑器入门指南
linux·编辑器·vim
洪流之源15 小时前
Windows 远程 Ubuntu 24.04 桌面
linux·windows·ubuntu