本文参考官网地址:https://docs.docker.com/install/linux/docker-ce/centos/#os-requirements

1、卸载旧版本的docker

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

2、安装依赖的工具

$ sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2

yum-utils 提供了 yum-config-manager 功能,该功能后边会用到

device-mapper-persistent-data 和lvm2 是 devicemapper所需的依赖,devicemapper可以理解为一种docker用来存放容器和镜像的技术。

3、添加docker yum源,这时用到了 yum-config-manager

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

4、开启刚才下载的yum源

$ sudo yum-config-manager --enable docker-ce-edge
$ sudo yum-config-manager --enable docker-ce-test

第三步下载下来的repo中已经包含了edge 和 test 仓库,但是默认是关闭的,所以需要我们手动开启,我们也可以用下边的命令来关闭它们

$ sudo yum-config-manager --disable docker-ce-edge

5、安装docker

你可以通过以下命令安装最新版的docker:

$ sudo yum install docker-ce

也可以挑选一个特定的版本:

先列出所有可选版本

[root@MiWiFi-R3L-srv proc]# yum list docker-ce --showduplicates | sort -r

Repodata is over  weeks old. Install yum-cron? Or run: yum makecache fast
* updates: mirrors..com
Loaded plugins: fastestmirror
Installed Packages
* extras: mirrors.cn99.com
docker-ce.x86_64 17.12..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.1.ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.09..ce-.el7.centos installed
docker-ce.x86_64 17.09..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.06..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.06..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.06..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.03..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.03..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.03..ce-.el7.centos docker-ce-stable

如上文,已经列出了可用版本,我们选择所需要的版本,列表中第二列是版本号,第三列是package名

这里需要拼一下软件名,使用图中标红位置的字符串“docker-ce”和“17.09.1.ce”,再加上一个“-”,即可拼成。

比如我们要装17.09.1版的,那么软件名就是docker-ce-17.09.1.ce

官网原文(嘟嘟嘟一堆,又是可以使用全名,又是至少要到什么位置……不看也罢):

The contents of the list depend upon which repositories are enabled, and are specific to your version of
CentOS (indicated by the .el7 suffix on the version, in this example). Choose a specific version to install.
The second column is the version string. You can use the entire version string, but you need to include at least to the first hyphen.
The third column is the repository name, which indicates which repository the package is from and by extension its stability level.
To install a specific version, append the version string to the package name and separate them by a hyphen (-).
$ sudo yum install <你刚才拼出来的名称>

6、开启docker守护线程(服务端)

$ sudo systemctl start docker

7、跑个image试一下

$ sudo docker run hello-world

Centos7 安装 docker-ce的更多相关文章

  1. Centos7安装Docker CE

      每次安装Docker都要去找文档,或者每次安装的都不一样,还是要好好管理自己的这些东西,下次用的时候可以省很多的时间   Docker的早期版本称为docker或docker-engine:现在的 ...

  2. CentOS7 安装 Docker CE步骤

    准备工作 系统要求 Docker CE 支持 64 位版本 CentOS 7,并且要求内核版本不低于 3.10. CentOS 7 满足最低内核的要求,但由于内核版本比较低,部分功能(如 overla ...

  3. Centos7 安装docker ce

    一. 安装docker 1.升级rpm包 yum -y update 2. 通过命令设置Docker CE 资源库: yum install -y yum-utils yum-config-manag ...

  4. 在centos7上安装Docker CE

    Docker CE的基本安装 https://docs.docker.com/engine/installation/linux/docker-ce/centos/ 一.系统要求 1.安装Docker ...

  5. centos7 下安装Docker CE

    前提条件 操作系统要求 要保证centos-extrasrepository开启(enabled).默认处于开启状态. 推荐使用overlay2存储驱动 卸载老版本 $ sudo yum remove ...

  6. CentOS7 下 yum 安装 Docker CE

    前言 Docker 使用越来越多,安装也很简单,本次记录一下基本的步骤. Docker 目前支持 CentOS 7 及以后的版本,内核要求至少为 3.10. Docker 官网有安装步骤,本文只是记录 ...

  7. Docker进阶之四:centos7安装docker

    centos7.6 安装docker 参考:https://docs.docker.com/install/linux/docker-ce/centos/ 一.存在老版本先删除 yum remove ...

  8. centos7 部署 docker ce

    =============================================== 2019/4/9_第1次修改                       ccb_warlock === ...

  9. 【运维技术】VM虚拟机上使用centos7安装docker启动gogs服务教程【含B站视频教程】

    VM虚拟机上使用centos7安装docker启动gogs服务视频教程 BiliBili视频教程链接飞机票,点我 使用VMware Workstation安装Centos7 MinMal系统 第一步: ...

  10. ubuntu16.04安装docker CE

    如需开始在 Ubuntu 上使用 Docker CE,请确保您满足先决条件,然后再安装 Docker. 如需安装 Docker 企业版 (Docker EE),请转至获取适用于 Ubuntu 的 Do ...

随机推荐

  1. 使用Bootstrap后,关于IE与Chrome显示字体的问题

    在做日志系统时,使用了Bootstrap,然后通过浏览器查看的页面效果如下 对比可以看到,同样的字体,IE显示的圆润些,而Chrome字体则丑很多.因为Chrome默认用宋体 在http://v3.b ...

  2. probotuf 标量数值类型

    标量数值类型 一个标量消息字段可以含有一个如下的类型--该表格展示了定义于.proto文件中的类型,以及与之对应的.在自动生成的访问类中定义的类型: .proto类型 Java 类型 C++类型 备注 ...

  3. 【FTP资源】发现一个ArcGIS相关的FTP。

    用谷歌 在搜索 ArcGISEngineRT的时候,发现了一个站点: ftp://ftp.geobc.gov.bc.ca/pub/outgoing/GeoBC_software_distributio ...

  4. @Param注解在Mybatis中的使用 以及传递参数的三种方式

    第一种: Dao层的方法 public User selectUser(String name,String password); 对应的Mapper.xml <select id=" ...

  5. 整理:FPGA选型

    针对性整理下FPGA选型问题 一.获取芯片资料: 要做芯片的选型,首先就是要对有可能要面对的芯片有整体的了解,也就是说要尽可能多的先获取芯片的资料.现在FPGA主要有4个生产厂家,ALTERA,XIL ...

  6. HTTP协议学习【转】

    面试过程中又一个常见的问题,http协议,因为做服务器开发如果用http协议的话,现在各种开源软件都封装好了,python中只需要简单的继承定义好的类,重写get或者post等方法,几行代码就可以搭建 ...

  7. verilog语法实例学习(10)

    常用的时序电路介绍 T触发器和JK触发器 在D触发器输入端添加一些简单的逻辑电路,可以生成另一种类型的存储元件.比如下图所示的T触发器.该电路有一个上升沿触发的触发器和两个与门,一个或门,以及一个反相 ...

  8. Ajax 中正常使用jquery-easyui (转)

    一.ASP.NET Ajax 页面中应用了 jquery-easyui,当页面进行回发操作后只是局部刷新,原本的EASYUI 样式无法生效.解决这个问题的思路是让页面在回发后重新调用EASYUI进行重 ...

  9. sgd学习率选择问题

    关于使用SGD时如何选择初始的学习率(这里SGD是指带动量的SGD,momentum=0.9): 训练一个epoch,把学习率从一个较小的值(10-8)上升到一个较大的值(10),画出学习率(取log ...

  10. Binary Tree Maximum Path Sum leetcode java

    题目: Given a binary tree, find the maximum path sum. The path may start and end at any node in the tr ...