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

相关推荐
林政硕(Cohen0415)3 小时前
ARM Linux Qt Widget 虚拟键盘输入法移植
linux·arm开发·qt·键盘·输入法
萌萌哒草头将军10 小时前
绿联云 NAS 安装 AudioDock 详细教程
前端·docker·容器
haimin037110 小时前
linux设置CPU固定频率
linux·运维·服务器
大聪明-PLUS10 小时前
Linux:处理器释放内存
linux·嵌入式·arm·smarc
apocelipes11 小时前
docker-compose 部署单节点 kafka 4.0 测试环境
docker·golang·kafka·开发工具和环境
渣渣盟11 小时前
NFS服务器配置全攻略:从入门到精通
linux·运维·服务器
一只旭宝11 小时前
Linux专题九:I/O复用(水平以及边缘触发放到libevent库那一专题细讲)
linux·运维·服务器
缘如风11 小时前
Linux上sunrpc 111端口关闭
linux·服务器
I · T · LUCKYBOOM12 小时前
iptables防火墙
linux·运维·服务器·网络·安全
山上三树12 小时前
main()函数带参数的用法
linux·c语言