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

相关推荐
黄筱筱筱筱筱筱筱34 分钟前
LINUX-防火墙
linux·服务器·网络
сокол1 小时前
【网安-Web渗透测试-靶场系列】AWD-Platform(ctf-hub)
linux·服务器·ubuntu·网络安全·docker
utf8mb4安全女神2 小时前
Linux系统服务相关命令【定时任务设置】【任务进程管理】【防火墙区域应用】
linux·运维·服务器
月走乂山4 小时前
Windows 10 WSL2 安装问题排查与解决全记录
windows·docker·hyper-v·故障排查·wsl2
不吃土豆的马铃薯5 小时前
Spdlog 进阶:日志基本控制、日志格式控制、异步记录器
linux·服务器·开发语言·前端·c++
疯狂成瘾者5 小时前
常见的 Linux 版本
linux·运维·服务器
szxinmai主板定制专家5 小时前
基于ZYNQ MPSOC图像采集与压缩系统总体设计方案
linux·arm开发·人工智能·嵌入式硬件·fpga开发
liulilittle5 小时前
TCP UCP:基于卡尔曼滤波的BBR增强型拥塞控制算法
linux·网络·c++·tcp/ip·算法·c·通讯
tianrun12346 小时前
Ubuntu 24.04 安装 Fcitx5 + Rime + 搜狗词库(替代 IBus 与 Linux 搜狗输入法)
linux·运维·ubuntu
wxytxdy6 小时前
通过猜数字游戏学习Shell脚本的分支、循环编写
linux·学习