更新
根据官网提供的教程,可以使用apt-get安装docker
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce
apt-cache madison docker-ce
sudo docker container run hello-world
# Verify that Docker CE is installed correctly by running the hello-world image.
可以将docker
加到sudo
用户组,这样不用每次输入sudo docker了
sudo groupadd docker
sudo usermod -aG docker $USER
# Log out and log back in so that your group membership is re-evaluated.
docker run hello-world
# Verify that you can run docker commands without sudo.
参考
Ubuntu14.04下安装docker
《第一本docker书》-JamesTurnbull
docker本身在ubuntu的软件包里面包含有,但是不一定是最新版,所以本文通过添加docker源来安装
系统要求
Linux内核在3.8以上
ubuntu 12.04.3以上,64位
RHEL(CentOS)6以上,64位
Fedora Core 19以上,64位
##其他要求
Device Mapper 作为存储驱动,2.6.9以后的Linux内核应该都支持
修改UFW, /etc/default/ufw 中 DEFAULT_FORWARD_POLICY=“DROP” 改为 DEFAULT_FORWARD_POLICY=“ACCEPT”
本文的系统版本是 ubuntu 14.04 64位
安装
sudo apt-get install apt-transport-https
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo bash -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get install lxc-docker
安装之后,输入
sudo docker info
确认安装成功