版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/huangjun0210/article/details/86627181
1. 搭建环境简介
- ubuntu18.06
- docker 18.09.1
此次安装是在root用户下进行,因此,命令不需要sudo
2. 添加docker源公钥
# 更新下包
apt-get update
# 若提示未安装 curl
apt install curl
# 添加docker源公钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
3. 添加docker源的仓库
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
查看添加后的 vi /etc/apt/sources.list
再次更新下包
apt-get update
4. 安装docker
查看docker有哪些版本 apt-cache madison docker-ce
安装最新版本
apt-get install docker-ce
5. 验证
docker version
hello docker
docker run hello-world