hlcX's Blog
my note!
Toggle navigation
hlcX's Blog
2.学习
4.群晖
5.CentOS7
6.rasperryPI
linux-mint
关于
归档
标签
CentOS7下安装Docker
docker
2019-10-02 20:01:47
5
0
0
hlcx
docker
# 安装Docker - 把yum包更新到最新(不要问我为什么) ``` [root@localhost ~]# yum update 已加载插件:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: centos.ustc.edu.cn * extras: mirrors.aliyun.com * updates: centos.ustc.edu.cn 正在解决依赖关系 --> 正在检查事务 ---> 软件包 bind-libs.x86_64.32.9.9.4-61.el7 将被 升级 ---> 软件包 bind-libs.x86_64.32.9.9.4-61.el7_5.1 将被 更新 ---> 软件包 bind-libs-lite.x86_64.32.9.9.4-61.el7 将被 升级 ---> 软件包 bind-libs-lite.x86_64.32.9.9.4-61.el7_5.1 将被 更新 ---> 软件包 bind-license.noarch.32.9.9.4-61.el7 将被 升级 ---> 软件包 bind-license.noarch.32.9.9.4-61.el7_5.1 将被 更新 ... ... 验证中 : 32:bind-license-9.9.4-61.el7.noarch 8/8 更新完毕: bind-libs.x86_64 32:9.9.4-61.el7_5.1 bind-libs-lite.x86_64 32:9.9.4-61.el7_5.1 bind-license.noarch 32:9.9.4-61.el7_5.1 bind-utils.x86_64 32:9.9.4-61.el7_5.1 完毕! [root@localhost ~]# ``` - 安装需要的软件包 ``` [root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2 已加载插件:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: centos.ustc.edu.cn * extras: mirrors.aliyun.com * updates: centos.ustc.edu.cn ... ``` - 设置yum源 ``` [root@localhost ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo 已加载插件:fastestmirror, langpacks adding repo from: https://download.docker.com/linux/centos/docker-ce.repo grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo repo saved to /etc/yum.repos.d/docker-ce.repo ``` - 可以查看所有仓库中所有docker版本,并选择特定版本安装 ``` [root@localhost ~]# yum list docker-ce --showduplicates | sort -r 已加载插件:fastestmirror, langpacks 可安装的软件包 * updates: centos.ustc.edu.cn Loading mirror speeds from cached hostfile * extras: mirrors.aliyun.com docker-ce.x86_64 18.06.1.ce-3.el7 docker-ce-stable docker-ce.x86_64 18.06.0.ce-3.el7 docker-ce-stable docker-ce.x86_64 18.03.1.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 18.03.0.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.12.1.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.12.0.ce-1.el7.centos docker-ce-stable ... ``` - 安装Docker,命令:yum install docker-ce-版本号 ``` [root@localhost ~]# yum install docker-ce-17.12.1.ce 已加载插件:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: centos.ustc.edu.cn * extras: mirrors.aliyun.com * updates: centos.ustc.edu.cn base | 3.6 kB 00:00 docker-ce-stable | 2.9 kB 00:00 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 正在解决依赖关系 --> 正在检查事务 ---> 软件包 docker-ce.x86_64.0.17.12.1.ce-1.el7.centos 将被 安装 --> 正在处理依赖关系 container-selinux >= 2.9,它被软件包 docker-ce-17.12.1.ce-1.el7.centos.x86_64 需要 ... ``` - 启动Docker,命令,然后加入开机启动 ``` [root@localhost ~]# systemctl start docker [root@localhost ~]# systemctl enable docker Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. ``` - 验证安装是否成功 ``` [root@localhost ~]# docker version Client: Version: 17.12.1-ce API version: 1.35 Go version: go1.9.4 Git commit: 7390fc6 Built: Tue Feb 27 22:15:20 2018 OS/Arch: linux/amd64 Server: Engine: Version: 17.12.1-ce API version: 1.35 (minimum version 1.12) Go version: go1.9.4 Git commit: 7390fc6 Built: Tue Feb 27 22:17:54 2018 OS/Arch: linux/amd64 Experimental: false ``` # over
上一篇:
给CentOS7换163的源
下一篇:
Centos7开启SSH服务
0
赞
5 人读过
新浪微博
微信
腾讯微博
QQ空间
人人网
提交评论
立即登录
, 发表评论.
没有帐号?
立即注册
0
条评论
More...
文档导航
没有帐号? 立即注册