系统需求
To install Docker, you need the 64-bit version of one of these Ubuntu versions:
Yakkety 16.10
Xenial 16.04 (LTS)
Trusty 14.04 (LTS)
增加额外依赖包类似epel
sudoapt−getupdate sudo apt-get install curl \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
安装docker
需要安装https认证
apt-get install apt-transport-https \
ca-certificates
增加docker的GPGkey(GPG是加密用的)
curl -fsSL https://yum.dockerproject.org/gpg | sudo apt-key add -
有效的key是
apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D
添加docker仓库
add-apt-repository \
“deb https://apt.dockerproject.org/repo/ \
ubuntu-$(lsb_release -cs) \
main”
也可以手动在/etc/apt/sources.list添加
升级apt-get
apt-get update
开始装
apt-get -y install docker-engine
当然也可以选docker的版本,默认就是最新的
apt-get -y install docker-engine=\
运行一下
docker run hello-world
搞定