![](https://ask.qcloudimg.com/http-save/yehe-6073367/89452922210fabf063e35785d9c11a91.jpeg) 这里建议大家使用阿里云的镜像源 第一步 安装所需的工具包sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common第二步 修改源文件权限sudo chmod 777 /etc/apt/sources.list //设置文件可读可写可执行第三步 将源文件内容替换成阿里源 如下:deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse第四步 添加阿里公钥 以便于访问仓库curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -第五步 添加Docker软件源echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list第六步 更新软件包缓存sudo apt-get update第七步 安装dockersudo apt-get install docker-engine第八部 启动dockersudo systemctl enable docker
sudo systemctl start docker第9步 测试经典的hello world sudo docker run hello-world执行 sudo docker run hello-world 的时候,如果你没有构建过这个hello-world镜像,或从其它地方拉取过这个镜像,docker自动去docker上拉取最新的hello-world 镜像 至此 docker安装完成
|