软件环境:
windows:7
vmware:14.1.1 build-7528167
ubuntu镜像:ubuntu-16.04.5-desktop-amd64.iso
docker:18.06.1-ce
1、从地址http://mirror.pnl.gov/releases/xenial/ 下载镜像。
2、vmware中安装ubuntu镜像。
3、设置镜像加速器。
# 备份原文件
mv /etc/apt/sources.list /etc/apt/sources.list.bak
# 修改为阿里云的镜像源
cat > /etc/apt/sources.list << END
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
END
# 更新源列表信息
apt-get update
4、安装docker
卸载老版本
sudo apt-get remove docker docker-engine docker.io
更新源
sudo apt-get update
允许apt在https之上使用仓库
apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
添加docker官方的GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
检查你有这个key
apt-key fingerprint 0EBFCD88
创建一个稳定的仓库
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
更新apt索引
apt-get update
安装最新版本的docker
apt-get install docker-ce
列出仓库中你可用的版本
apt-cache madison docker-ce
可以安装制定的版本
apt-get install docker-ce=<VERSION>
坚持是否安装成功!
docker run hello-world
如图示则安装成功