当前位置: 首页 > news >正文

CentOS系统安装Docker Engine

文章目录

  • 1 卸载旧版本
  • 2 安装依赖
  • 3 配置repo源
  • 4 安装docker engine
    • 4.1 安装最新版docker engine
    • 4.2 安装指定版本的docker engine
  • 5 启动docker
  • 6 使用 hello-world 镜像验证安装结果

1 卸载旧版本

sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

2 安装依赖

sudo yum install -y yum-utils

3 配置repo源

sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

4 安装docker engine

4.1 安装最新版docker engine

sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin

4.2 安装指定版本的docker engine

首先查看可以安装的版本

yum list docker-ce --showduplicates | sort -r

比如执行结果如下:

比如安装 18.06.3.ce-3.el7 版本,则执行命令如下

sudo yum install docker-ce-18.06.3.ce-3.el7 docker-ce-cli-18.06.3.ce-3.el7 containerd.io docker-compose-plugin

5 启动docker

sudo systemctl start docker

6 使用 hello-world 镜像验证安装结果

sudo docker run hello-world

执行结果如下,表示docker已经安装成功

[root@osssc-dev-01 ~]# sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:2498fce14358aa50ead0cc6c19990fc6ff866ce72aeb5546e1d59caac3d0d60f
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

[root@osssc-dev-01 ~]#

相关文章:

  • 【Node.js 入门篇】连接 MySQL
  • 一文带你读懂Vue生命周期
  • Java顺序表的实现
  • 金仓数据库KingbaseES数据库参考手册(服务器配置参数18. 开发者选项)
  • mysql 跨库数据清洗方案
  • pandas数据映射,更改列名,批量映射替换某列数据replace、map、apply、rename对比
  • 未婚妻晚安之后依然在线,于是我用20行代码写了个小工具
  • MySQL进阶第二天——索引
  • 低代码 low-code
  • 数字经济增长下,数据共享对于企业而言意味着什么?
  • 浙大MEM网上报名关键信息点提醒,选错一个,回头重来
  • 基于Spring Boot的动物救助中心系统
  • 6.HTML标签/元素学习
  • 没前端项目经验很难找实习吗?
  • C#基础--委托、lambda表达式和事件
  • [译]如何构建服务器端web组件,为何要构建?
  • 【编码】-360实习笔试编程题(二)-2016.03.29
  • 3.7、@ResponseBody 和 @RestController
  • Apache Pulsar 2.1 重磅发布
  • express.js的介绍及使用
  • Java多态
  • Joomla 2.x, 3.x useful code cheatsheet
  • k8s 面向应用开发者的基础命令
  • Map集合、散列表、红黑树介绍
  • Median of Two Sorted Arrays
  • SegmentFault 2015 Top Rank
  • ucore操作系统实验笔记 - 重新理解中断
  • vue2.0项目引入element-ui
  • webpack入门学习手记(二)
  • 对话 CTO〡听神策数据 CTO 曹犟描绘数据分析行业的无限可能
  • 工作踩坑系列——https访问遇到“已阻止载入混合活动内容”
  • 简单易用的leetcode开发测试工具(npm)
  • 使用Swoole加速Laravel(正式环境中)
  • 正则表达式小结
  • ​ ​Redis(五)主从复制:主从模式介绍、配置、拓扑(一主一从结构、一主多从结构、树形主从结构)、原理(复制过程、​​​​​​​数据同步psync)、总结
  • ​【已解决】npm install​卡主不动的情况
  • ​虚拟化系列介绍(十)
  • !!Dom4j 学习笔记
  • (1)(1.11) SiK Radio v2(一)
  • (2)MFC+openGL单文档框架glFrame
  • (delphi11最新学习资料) Object Pascal 学习笔记---第8章第5节(封闭类和Final方法)
  • (二)什么是Vite——Vite 和 Webpack 区别(冷启动)
  • (官网安装) 基于CentOS 7安装MangoDB和MangoDB Shell
  • (一)Spring Cloud 直击微服务作用、架构应用、hystrix降级
  • (转)es进行聚合操作时提示Fielddata is disabled on text fields by default
  • (转载)Linux 多线程条件变量同步
  • .NET 8 编写 LiteDB vs SQLite 数据库 CRUD 接口性能测试(准备篇)
  • .net core 6 redis操作类
  • .NET 常见的偏门问题
  • .NET(C#、VB)APP开发——Smobiler平台控件介绍:Bluetooth组件
  • .Net程序猿乐Android发展---(10)框架布局FrameLayout
  • .NET关于 跳过SSL中遇到的问题
  • .NET与 java通用的3DES加密解密方法
  • .Net中的设计模式——Factory Method模式
  • .NET中使用Redis (二)