前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ubuntu安装docker详细步骤

ubuntu安装docker详细步骤

作者头像
乱码三千
发布2021-07-29 15:57:42
1.6K0
发布2021-07-29 15:57:42
举报
文章被收录于专栏:乱码三千

这里建议大家使用阿里云的镜像源

第一步 安装所需的工具包

代码语言:javascript
复制
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

第二步 修改源文件权限

代码语言:javascript
复制
sudo chmod 777 /etc/apt/sources.list //设置文件可读可写可执行

第三步 将源文件内容替换成阿里源 如下:

代码语言:javascript
复制
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

第四步 添加阿里公钥 以便于访问仓库

代码语言:javascript
复制
curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -

第五步 添加Docker软件源

代码语言:javascript
复制
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list

第六步 更新软件包缓存

代码语言:javascript
复制
sudo apt-get update

第七步 安装docker

代码语言:javascript
复制
sudo apt-get install docker-engine

第八部 启动docker

代码语言:javascript
复制
sudo systemctl enable docker
sudo systemctl start docker

第9步 测试经典的hello world

代码语言:javascript
复制
 sudo docker run hello-world

执行 sudo docker run hello-world 的时候,如果你没有构建过这个hello-world镜像,或从其它地方拉取过这个镜像,docker自动去docker上拉取最新的hello-world 镜像

至此 docker安装完成

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2020-01-22,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 乱码三千 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 第一步 安装所需的工具包
  • 第二步 修改源文件权限
  • 第三步 将源文件内容替换成阿里源 如下:
  • 第四步 添加阿里公钥 以便于访问仓库
  • 第五步 添加Docker软件源
  • 第六步 更新软件包缓存
  • 第七步 安装docker
  • 第八部 启动docker
  • 第9步 测试经典的hello world
相关产品与服务
容器服务
腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档