CentOS安装Docker
版本:CentOS-7-x86_64-DVD-180
更新yum包
yum -y update : 升级所有包同时也升级软件和系统内核
yum -y upgrade : 只升级所有包,不升级软件和系统内核
安装需要的软件包
yum install -y yum-utils device-mapper-persistent-data lvm2
设置yum源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装docker
yum -y install docker-ce
启动docker,并设置开机自启
systemctl start docker
systemctl enable docke安装
配置阿里云镜像加速器
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://0m86hj6p.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker