点击查看代码
yum install -y yum-utils device-mapper-persistent-data lvm2 #docker 依赖包的安装
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo #设置阿里云 docker-ce yum 镜像源,
yum install -y docker-ce #下载安装 docker 社区版
systemctl start docker #启动docker命令
systemctl enable docker #设置开机自启命令
docker version #查看docker版本命令
点击查看代码
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://2tefyfv7.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker