-
切换到root权限或者用sudo
-
升级source列表并保证https和ca证书成功安装
root@ubuntu-linux:~# apt-get updateroot@ubuntu-linux:~# apt-get install apt-transport-https ca-certificates
- 增加新的GPG 密钥
root@ubuntu-linux:~# apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
- 新增或编辑source列表里的docker.list文件
root@ubuntu-linux:~# vi /etc/apt/sources.list.d/docker.list //如果不存在就新增# 删除已有的entriesdeb https://apt.dockerproject.org/repo ubuntu-xenial main
- 重新执行更新操作,并删除老的repo
root@ubuntu-linux:~# apt-get purge lxc-docker //没有安装的话,跳过
- 查看是否有正确的可用版本
root@ubuntu-linux:~# apt-cache policy docker-enginedocker-engine: Installed: (none) Candidate: 17.05.0~ce-0~ubuntu-xenial Version table: 17.05.0~ce-0~ubuntu-xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 17.04.0~ce-0~ubuntu-xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 17.03.1~ce-0~ubuntu-xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 17.03.0~ce-0~ubuntu-xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 1.13.1-0~ubuntu-xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 1.13.0-0~ubuntu-xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 1.12.6-0~ubuntu-xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 1.12.5-0~ubuntu-xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 1.12.4-0~ubuntu-xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 1.12.3-0~xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 1.12.2-0~xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 1.12.1-0~xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 1.12.0-0~xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 1.11.2-0~xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 1.11.1-0~xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages 1.11.0-0~xenial 500 500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
- 从14.04版本]( "在这里输入图片标题")以上开始docker推荐安装linux-image-extra
root@ubuntu-linux:~# apt-get install linux-image-extra-$(uname -r)
- 安装docker
root@ubuntu-linux:~# apt-get updateroot@ubuntu-linux:~# apt-get install docker-engineroot@ubuntu-linux:~# service docker startroot@ubuntu-linux:~# docker run hello-world