Docker在CentOS 7下的安装
一、检查前提条件
1.内核
检查内核的版本是否安装了3.8或更高的版本
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-123.13.2.el7.x86_64 #1 SMP Thu Dec 18 14:09:13 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
2.检查Device Mapper
[root@localhost ~]# ls -l /sys/class/misc/device-mapper/
总用量 0
-r–r–r–. 1 root root 4096 12月 28 17:18 dev
drwxr-xr-x. 2 root root 0 12月 28 17:14 power
lrwxrwxrwx. 1 root root 0 12月 28 17:18 subsystem -> ../../../../class/misc
-rw-r–r–. 1 root root 4096 12月 28 17:13 uevent
或者在/proc/device文件中检查是否有device-mapper条目
[root@localhost ~]# grep device-mapper /proc/devices
253 device-mapper
二、安装Docker
[root@localhost ~]# yum -y install docker
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* epel: ftp.sjtu.edu.cn
* extras: mirrors.btte.net
* updates: mirrors.neusoft.edu.cn
正在解决依赖关系
–> 正在检查事务
—> 软件包 docker.x86_64.0.1.3.2-4.el7.centos 将被 安装
–> 解决依赖关系完成
依赖关系解决
===========================================================================================
Package 架构 版本 源 大小
===========================================================================================
正在安装:
docker x86_64 1.3.2-4.el7.centos extras 5.6 M
事务概要
===========================================================================================
安装 1 软件包
总下载量:5.6 M
安装大小:24 M
Downloading packages:
docker-1.3.2-4.el7.centos.x86_64.rpm | 5.6 MB 00:00:04
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : docker-1.3.2-4.el7.centos.x86_64 1/1
验证中 : docker-1.3.2-4.el7.centos.x86_64 1/1
已安装:
docker.x86_64 0:1.3.2-4.el7.centos
完毕!
三、启动Docker进程
[root@localhost ~]# systemctl start docker
如果想在开机的时间自动启动Docker服务,执行如下命令
[root@localhost ~]# systemctl enable docker
ln -s ‘/usr/lib/systemd/system/docker.service’ ‘/etc/systemd/system/multi-user.target.wants/docker.service’
查看Docker是否运行
[root@localhost ~]# docker info
Containers: 0
Images: 0
Storage Driver: devicemapper
Pool Name: docker-253:1-614613-pool
Pool Blocksize: 65.54 kB
Data file: /var/lib/docker/devicemapper/devicemapper/data
Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata
Data Space Used: 307.2 MB
Data Space Total: 107.4 GB
Metadata Space Used: 725 kB
Metadata Space Total: 2.147 GB
Library Version: 1.02.84-RHEL7 (2014-03-26)
Execution Driver: native-0.2
Kernel Version: 3.10.0-123.13.2.el7.x86_64
Operating System: CentOS Linux 7 (Core)
CentOS 6/7系列安装Docker http://www.linuxidc.com/Linux/2014-07/104768.htm
Docker的搭建Gitlab CI 全过程详解 http://www.linuxidc.com/Linux/2013-12/93537.htm
Docker安装应用(CentOS 6.5_x64) http://www.linuxidc.com/Linux/2014-07/104595.htm
在 Docker 中使用 MySQL http://www.linuxidc.com/Linux/2014-01/95354.htm
在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker http://www.linuxidc.com/Linux/2014-10/108184.htm
Docker安装应用(CentOS 6.5_x64) http://www.linuxidc.com/Linux/2014-07/104595.htm
Ubuntu 14.04安装Docker http://www.linuxidc.com/linux/2014-08/105656.htm
阿里云CentOS 6.5 模板上安装 Docker http://www.linuxidc.com/Linux/2014-11/109107.htm
Docker 的详细介绍:请点这里
Docker 的下载地址:请点这里
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-12/110947.htm