# Get Docker CE for Ubuntu
https://docs.docker.com/install/linux/docker-ce/ubuntu/
Uninstall old versions
$ sudo apt-get remove docker docker-engine docker.io
docker的相关文件保存在/var/lib/docker/目录下,现在新的包名叫docker-ce
三种安装方式
repository安装
set up the repository
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg (opens new window) | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88 #通过查找最后8个字符以确认拥有9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88密匙
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu (opens new window) $(lsb_release -cs) stable
install docker ce
$ sudo apt-get update
$ sudo apt-get install docker-ce
$ sudo apt-cache madison docker-ce #查找可用版本
$ sudo apt-get install docker-ce=
#安装指定版本,生产环境一般不安装最新版本(apt-get install docker-ce=17.12.1~ce-0~ubuntu) $ sudo docker run hello-world
package安装
download .deb file
https://download.docker.com/linux/ubuntu/dists/
pool/stable/amd64=>.deb file
$ wget https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-ce_17.12.1~ce-0~ubuntu_amd64.deb
http://releases.ubuntu.com/ (opens new window) (查看对应的版本)
$ sudo dpkg -i docker-ce_17.12.1~ce-0~ubuntu_amd64.deb
$ sudo docker run hello-world
脚本安装
$ curl -fsSL get.docker.com (opens new window) -o get-docker.sh
$ sudo sh get-docker.sh