#!/bin/bash
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
yum install docker-ce dockear-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
systemctl stop firewalld.service && systemctl disable firewalld.service
iptables -F
iptables-save
echo "net.bridge.bridge-nf-call-iptables = 1" > /etc/sysctl.d/docker-net.conf echo "net.bridge.bridge-nf-call-ip6tables = 1" >> /etc/sysctl.d/docker-net.conf echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.d/docker-net.conf
modprobe overlay
modprobe br_netfilter
echo "overlay" > /etc/modules-load.d/docker.conf echo "br_netfilter" >> /etc/modules-load.d/docker.conf
sysctl -p /etc/sysctl.d/docker-net.conf
systemctl start docker
mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://s8yrzto6.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker