说明
按照官方文档安装失败,被墙了,换阿里云镜像
步骤
# 安装依赖工具
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
# 安装 GPG 证书
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# 验证证书
sudo apt-key fingerprint 0EBFCD88
# 写入软件源信息
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
# 更新并安装 Docker-CE
sudo apt-get update
sudo apt-get -y install docker-ce
参考
https://yq.aliyun.com/articles/110806?spm=5176.8351553.0.0.3c3a1991B3yurQ