美文网首页
centos7 快速安装docker

centos7 快速安装docker

作者: 杭城码龙 | 来源:发表于2018-11-23 14:17 被阅读0次

Docker是一个基于Go语言的开源的应用容器引擎,目前windows、mac和linux都支持Docker,但是线上服务器大都是linux系统,所以这里就介绍linux怎么安装Docker。

安装步骤:

本测试机是centos7的版本:
[root@db02 ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
Docker 运行在 CentOS 7 上,要求系统为64位、系统内核版本为 3.10 以上
查看内核版本:
[root@db02 ~]# uname -r
3.10.0-862.el7.x86_64

1.先安装一些必要的系统工具, yum-utils提供yum-config-manager功能,另外两个是device mapper驱动依赖的:

[root@db02 ~]# yum install -y yum-utils device-mapper-persistent-data lvm2

2. 设置yum源,这里配置的是阿里云的yum源:

[root@db02 ~]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

3.安装docker:

[root@db02 ~]# yum install docker-ce

4.启动docker:

[root@db02 ~]# systemctl start docker

5.加入开机自启:

[root@db02 ~]# systemctl enable docker

6.测试运行Docker,这里我们也来个hello-world.

[root@db02 ~]# docker run hello-world

相关文章

网友评论

      本文标题:centos7 快速安装docker

      本文链接:https://www.haomeiwen.com/subject/pydjqqtx.html