docker
Posted wawahan
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker相关的知识,希望对你有一定的参考价值。
一、安装
rhel,centos
1、检查内核版本: 使用docker需要在64微系统上,内核版本3.8.13以上,之前的版本也可以使用,但是兼容性可能不是很好
#查看内核版本 uname -a uname -r
2:检查device Mapper
我们这里使用Device Mapper 作为Docker的存储启动。
[root@centos-linux ~]# grep device-mapper /proc/devices 253 device-mapper
如果没有就安装
[root@centos-linux ~]# yum install device-mapper
*我有,但是我还是可以安装上。
安装完以后还需要加载dm_mod内核模块
[root@centos-linux ~]# modprobe dm_mod [root@centos-linux ~]# lsmod | grep dm_mod dm_mod 113292 8 dm_log,dm_mirror [root@centos-linux ~]# ls /sys/class/misc/device-mapper/ dev power subsystem uevent
3、安装
centos 7
[root@centos-linux yum.repos.d]# yum install subscription-manager
[root@centos-linux ~]# subscription-manager repos --enable=rhel-7-server-extras-rpms
想要访问red hat 的 docker 软件包和万当,必须是red hat的客户,并且拥有rhel服务器订阅权限(RHEL Server
sybscription entitlement)
不用上面一步也可安装
root@centos-linux ~]# yum install -y docker
4、启动
[root@centos-linux ~]# service docker start . or
[root@centos-linux ~]# systemctl start docker
开机启动
[root@centos-linux ~]# systemctl enable docker
[root@centos-linux ~]# systemctl list-dependencies docker 查看开机启动状
查看docker状态
[root@centos-linux ~]# docker info
Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 1.10.3 Storage Driver: devicemapper Pool Name: docker-253:0-67389343-pool Pool Blocksize: 65.54 kB Base Device Size: 10.74 GB Backing Filesystem: xfs Data file: /dev/loop0 Metadata file: /dev/loop1 Data Space Used: 11.8 MB Data Space Total: 107.4 GB Data Space Available: 17.86 GB Metadata Space Used: 581.6 kB Metadata Space Total: 2.147 GB Metadata Space Available: 2.147 GB Udev Sync Supported: true Deferred Removal Enabled: false Deferred Deletion Enabled: false Deferred Deleted Device Count: 0 Data loop file: /var/lib/docker/devicemapper/devicemapper/data WARNING: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning. Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata Library Version: 1.02.135-RHEL7 (2016-09-28) Execution Driver: native-0.2 Logging Driver: journald Plugins: Volume: local Network: host bridge null Kernel Version: 3.10.0-327.el7.x86_64 Operating System: CentOS Linux 7 (Core) OSType: linux Architecture: x86_64 Number of Docker Hooks: 2 CPUs: 2 Total Memory: 989.3 MiB Name: centos-linux.shared ID: WYHC:VVGT:BZN6:ONIH:DHIG:HCXK:67FB:AJST:NV3E:DC3R:XPCY:BINE WARNING: bridge-nf-call-iptables is disabled WARNING: bridge-nf-call-ip6tables is disabled Registries: docker.io (secure)