AnolisOS-8安装docker
环境
系统:Anolis 8.5.0-10.0.1
yum:公网yum
准备工作
关闭防火墙
systemctl stop firewalld
查看防火墙状态
systemctl status firewalld
关闭防火墙开机自启
systemctl disable firewalld
关闭selinux
setenforce 0
永久关闭selinux
vim /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
下载阿里仓库的yum源码
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
查看可下载的docker版本
yum list docker-ce --showduplicates | sort -r
选择一个版本使用yum安装,这里我选择的是最新版
yum -y install docker-ce-20.10.9-3.el8
安装的时候报错了,提示docker软件包依赖containerd.io,所以先用yum安装containerd.io
yum -y install containerd
安装的时候提示有冲突的软件包,根据提示,后面加上--allowerasing' 来替换冲突的软件包
yum -y install containerd --allowerasing
安装号containerd之后再安装docker
yum -y install docker-ce-20.10.9-3.el8
开启docker
systemctl start docker
设置开机自启动
systemctl enable docker
接下来就可以尽情的玩转容器啦