关闭防火墙和selinux
systemctl stop firewalld
systemctl disable firewalld
sed -i 's/SELINUX=enforcing/SELINUX=disabled/'/etc/selinux/config
安装依赖包
yum install -y yum-utils
添加docker 软件包源
yum-config-manager --add-rep https://download.docker.com/linux/centos/docker-ce.repo
yum-config-manager --add-rep https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装docker-ce
yum install -y docker-ce
启动docker 并设置开机启动
systemctl start docker
systemctl enable docker
配置加速器
cat >> /etc/docker/daemon.json << 'EOF'
{
"registry-mirrors": ["https://17npv5ux.mirror.aliyuncs.com"]
}
systemctl daemon-reload
systemctl restart docke