首页 > 代码库 > centos安装docker-ce shell脚本

centos安装docker-ce shell脚本

#!/bin/bash
yum -y install bc
kenel=`uname -r`
kenel=`echo ${kenel:0:3}`
if [ $(echo "${kenel} >= 3.10" | bc) = 1 ];then
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum -y install docker-ce
sudo systemctl start docker
sudo systemctl enable docker
else
echo "内核版本太低,请您升级内核版本"
fi

centos安装docker-ce shell脚本