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

相关推荐
Forever Nore1 小时前
LeetCode 14 最长公共前缀 - 纵向扫描
linux·服务器·leetcode
拂拉氏1 小时前
【知识讲解】 Linux权限相关知识讲解
linux·权限
倔强的石头1061 小时前
飞牛OS部署Mtab:Docker搭建自托管书签导航并实现远程访问
运维·docker·容器
桑榆4166 小时前
双系统(Windows + Ubuntu)安装流程
linux·windows·ubuntu
ltl13 小时前
实时 OS 巡礼:VxWorks、QNX、Zephyr 与 PREEMPT_RT
linux
我是谁??13 小时前
Ubuntu22.04更换清华源
linux·运维·服务器
Shell运维手记13 小时前
Linux 常用基础命令学习笔记
linux·运维·笔记·学习·算法·github
测试运维日常笔记15 小时前
Linux系统安装配置TigerVNC服务器完整指南
linux·运维·服务器
雾时之林16 小时前
Linux----cron定时服务
linux·运维·服务器
apgk116 小时前
基于Canal实现mysql数据同步到消息队列(RabbitMQ/Kafka)详细操作教程
docker·kafka·rabbitmq