一、安装Docker
(1)添加远程仓库地址
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
国内无法访问Docker官网,可以访问一些镜像站,如阿里云、CloudDao等,通过下面的命令设置
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://176a5be3.m.daocloud.io
阿里云的镜像
curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -
执行sudo apt-get update命令的时候,可能一直出现“waiting for headers”,出现这种问题的原因可能是多样的,解决的方法也是多样的。
具体可以参考如下方法,尝试着去解决:
(1)apt-get update very slow, stuck at “Waiting for headers”
注:我是根据上文中提供的第一种解决方式,把Download from的服务器改成了Server From