安装
- update
$ sudo apt-get update
- 安装 apt 依赖包,用于通过HTTPS来获取仓库
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
- 添加 Docker 的官方 GPG 密钥
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- 设置稳定版仓库(强烈建议换成阿里镜像加速的源,下面有教程)
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
- 安装 Docker-ce
$ sudo apt-get update
$ sudo apt-get