docker 支持的Ubuntu版本:
Ubuntu Trusty 14.04(LTS)(64-bit)
Ubuntu Precise 12.04(LTS)(64-bit)
Ubuntu Raring 13.04 and Saucy 13.10(64-bit)
安装前检查:
1、内核版本:
uname -a
2、检查Device Mapper:
ls -l /sys/class/misc/device-mapper
Ubuntu中安装Docker的方式
1、安装Ubuntu维护的版本
2、安装Docker维护的版本
安装 Ubuntu维护的版本:
1、 sudo apt-get install docker.io
2、 source /etc/bash_completion.d/docker.io
安装Docker维护的版本:
1、检查APT的HTTPS支持 查看/usr/lib/apt/methods/https文件是否存在
如果不存在,运行安装命令
apt-get update
apt-get install -y apt-transport-https
2、添加Docker的APT仓库
echo deb https://get.docker.com/ubuntu docker main >
/etc/apt/sources.list.d/docker.list
3、添加仓库的key
apt-key adv --keyserver hkp://keyserver.ubuntu.com;80
--recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
4、安装
apt-get update
将上述四个步骤写在一个shell脚本中,就上述的命令写在curl中
sudo apt-get install -y curl
curl -sSL https://get.docker.com/ubuntu/ | sudo sh
查看是否安装了curl
whereis curl
使用非root用户:
1、sudo groupadd docker
2、sudo gpasswd -a ${USER} docker
3、sudo service docker restart