Docker学习笔记(一)

Docker学习笔记(一)

一.安装Docker

在ubuntu上安装(参考https://blog.csdn.net/jinking01/article/details/82490688)
  • 先卸载可能存在的旧版本

sudo apt-get remove docker docker-engine docker-ce docker.io

  • 更新apt包索引

sudo apt-get update

  • 安装以下包以使apt可以通过HTTPS使用存储库(repository)

sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common

  • 添加Docker官方的GPG密钥

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

  • 设置stable存储库

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

  • 再更新一下apt包索引

sudo apt-get update

  • 安装最新版本的Docker CE(社区版)

sudo apt-get install -y docker-ce

  • 查看docker服务是否启动

systemctl status docker

  • 启动docker

sudo systemctl start docker

  • 测试是否安装成功

sudo docker run hello-world

二.Docker架构

三.配置镜像加速器

为了加速下载docker镜像,需要配置镜像加速器
这里采用阿里云提供的镜像加速器

  • 首先登陆到阿里云,搜索镜像,选择容器镜像服务

  • 进入后选择旁边菜单栏的镜像加速器

  • 之后按照旁边的说明配置就可以了
posted @ 2020-04-22 17:10  sfencs  阅读(134)  评论(0编辑  收藏  举报