- 安装包,允许 apt 命令 HTTPS 访问 Docker 源。
$ apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
- 添加 Docker 官方的 GPG
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
- 将 Docker 的源添加到 /etc/apt/sources.list
$ add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
安装 Docker
$ apt-get update
$ apt-get install docker-ce
4.出现问题
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
解决方法:https://blog.youkuaiyun.com/persistencegoing/article/details/93499019