Bootstrap

CentOS Stream release 9安装docker

1.安装Docker服务

yum -y install dnf   #安装dnf工具
yum install -y device-mapper-persistent-data lvm2  #安装Docker所需驱动
dnf config-manager --add-repo=https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo  #安装Docker的Yum源
dnf list docker-ce  #列出Docker-ce版本信息
yum install -y docker-ce --nobest  #安装Docker
systemctl start docker
systemctl enable  docker
systemctl status  docker
docker version
#添加加速器
cat > /etc/docker/daemon.json << EOF
{
  "registry-mirrors": ["https://qj799ren.mirror.aliyuncs.com","https://4c99aa72f1a643edb02b13b93fec6a17.mirror.swr.myhuaweicloud.com"],
  "insecure-registries": ["0.0.0.0/0"],
  "exec-opts": ["native.cgroupdriver=systemd"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "storage-driver": "overlay2"
}
EOF
systemctl restart docker
systemctl status docker
;