本文参考官网地址: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. 关于SqlBulkCopy SQL批量导入需要注意,列名是区分大小写的

    最近在做数据从Excel批量导入MSSQL时,传统的是使用Insert Into Table方法,不过这个方便比较慢 通过使用 SqlBulkCopy 可以批量导入到数据库. 默认批量导入数据库,需要 ...

  2. InnoDB Record, Gap, and Next-Key Locks

    InnoDB has several types of record-level locks including record locks, gap locks, and next-key locks ...

  3. GFW实现原理

    GFW的工作机制主要包括: 1. IP黑名单 2. 内容审查 3. DNS劫持 参考链接:http://www.doc88.com/p-8435599803718.html

  4. 网络编程之webclient和httpwebrequest的使用

    (1)Lambda表达式 “Lambda表达式”是一个匿名函数,它可以包含表达式和语句,并且可用于创建委托或表达式树类型. 所有 Lambda 表达式都使用 Lambda 运算符 =>,该运算符 ...

  5. windows下mysql忘记root密码的解决办法

    今天早上 一朋友说自己的mysql 忘记root密码了 让我帮忙给看看,因为没有接触过mysql 所以从网上找了一下信息经我亲身实践  已经成功!mysql版本是5.1以下是从网上找的信息: 1. 首 ...

  6. 泊松分布E(X^2)

    由于求期望实际就是求平均值,所以E(X^2)=E[X*X]=E[X*X]+E(X)-E(X)=E[X*X+X-X]=E[X(X-1)+X]E[X(X-1)+X]=E[X(X-1)]+E(X)即:和的平 ...

  7. Android -- Property Animation

    3.0以前,android支持两种动画模式,tween animation,frame animation,在android3.0中又引入了一个新的动画系统:property animation,这三 ...

  8. SSE,MSE,RMSE,R-square指标讲解

    SSE(和方差.误差平方和):The sum of squares due to errorMSE(均方差.方差):Mean squared errorRMSE(均方根.标准差):Root mean ...

  9. 转:Logistic regression (逻辑回归) 概述

    Logistic regression (逻辑回归)是当前业界比较常用的机器学习方法,用于估计某种事物的可能性.比如某用户购买某商品的可能性,某病人患有某种疾病的可能性,以及某广告被用户点击的可能性等 ...

  10. Kernel Memory Layout on ARM Linux

    这是内核自带的文档,讲解ARM芯片的内存是如何布局的!比较简单,对于初学者可以看一下!但要想深入理解Linux内存管理,建议还是找几本好书看看,如深入理解Linux虚拟内存,嵌入系统分析,Linux内 ...