root@debian1:~# cat /etc/os-release Docker 官方为了简化安装流程,提供了一套安装脚本,Ubuntu 和 Debian 系统可以使用这套脚本安装: 执行这个命令后,脚本就会自动的将一切准备工作做好,并且把 Docker 安装在系统中。 不过,由于伟大的墙的原因,在国内使用这个脚本可能会出现某些下载出现错误的情况。国内的一些云服务商提供了这个脚本的修改版本,使其使用国内的 Docker 软件源镜像安装,这样就避免了墙的干扰。
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
安装docker-engine
root@debian1:~# cat /etc/apt/sources.list
#
# deb cdrom:[Debian GNU/Linux 8 _Jessie_ - Official Snapshot amd64 LIVE/INSTALL Binary 20160917-14:33]/ jessie main
deb cdrom:[Debian GNU/Linux 8 _Jessie_ - Official Snapshot amd64 LIVE/INSTALL Binary 20160917-14:33]/ jessie main
deb http://mirrors.163.com/debian/ jessie main
deb-src http://mirrors.163.com/debian/ jessie main
deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main
# jessie-updates, previously known as 'volatile'
deb http://mirrors.163.com/debian/ jessie-updates main
deb-src http://mirrors.163.com/debian/ jessie-updates main
deb https:///repo debian-jessie main
导入key文件
apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
安装docker-engine
apt-get install docker-engine
坐等安装完毕即可使用脚本自动安装
curl -sSL https://get.docker.com/ | sh
阿里云的安装脚本
curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -
DaoCloud 的安装脚本
curl -sSL https:///docker | sh
加速器的安装
对于使用 systemd 的系统,用 systemctl enable docker 启用服务后,编辑 /etc/systemd/system/multi-user.target.wants/docker.service 文件,找到 ExecStart= 这一行,在这行最后添加加速器地址 --registry-mirror=<加速器地址>,如: 注:对于 1.12 以前的版本,dockerd 换成 docker daemon。 重新加载配置并且重新启动。Ubuntu 16.04、Debian 8 Jessie、CentOS 7
ExecStart=/usr/bin/dockerd --registry-mirror=https://
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
















