02-安装容器引擎

版权声明:本文为博主原创文章,未经博主允许不得转载。 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

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/huangjun0210/article/details/86627181
02-