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

相关推荐
拥友LikT15 分钟前
惠普DL380服务器安装系统以后无法读取到系统盘启动解决方案(其他品牌服务器类似解决思路)
linux·服务器系统安装
程序猿编码17 分钟前
Linux 文件变动监控工具:原理、设计与实用指南(C/C++代码实现)
linux·c语言·c++·深度学习·inotify
网硕互联的小客服19 分钟前
SSD和HDD存储应该如何选择?
linux·运维·服务器·网络·安全
lemon31062419 分钟前
浪潮服务器装linux系统步骤
linux·运维·服务器
gugugu.20 分钟前
Linux进程:进程状态
linux·运维·服务器
Wang's Blog25 分钟前
Linux小课堂: Apache虚拟主机配置之基于IP与域名的服务器部署指南
linux·服务器·apache
Wang's Blog30 分钟前
Linux小课堂: Apache服务在CentOS上的安装与基础配置指南
linux·centos·apache
我爱钱因此会努力33 分钟前
ansible实战- 循环创建多个用户
运维·服务器·centos
广药门徒35 分钟前
Linux 驱动开发中,主设备号和次设备号不同的两个驱动能否正常工作
linux·运维·驱动开发
踩坑小念37 分钟前
进程 线程 协程基本概念和区别 还有内在联系
java·linux·jvm·操作系统