Docker历险记(一)

在CentOs7中安装

安装条件 内核版本CentOs6注意,CentOs7可以,而且CentOS7 系统 CentOS-Extras 库中已带 Docker,可以直接安装。

我的环境就是阿里云>CentOs7
http://wiki.jikexueyuan.com/project/docker-technology-and-combat/centos.html

https://mos.meituan.com/library/26/how-to-install-docker-on-centos/

按照极客学院教程安装安装报错:

centos7 docker 安装 file /usr/lib/systemd/system/blk-availability.service from install of device-mapper-7:1.02.107-5.el7_2.1.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64

解决方法:
[root@localhost ~]# yum install lvm2 -y
[root@localhost ~]# yum install docker-io -y

http://www.roddypy.com/index.php/2016/03/11/centos7-yum-%E5%AE%89%E8%A3%85docker%E6%8A%A5%E9%94%99/

启动

[root@localhost /]# systemctl start docker.service
Job for docker.service failed. See ‘systemctl status docker.service’ and ‘journalctl -xn’ for details.
[root@localhost /]# systemctl status docker.service
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled)
Active: failed (Result: start-limit) since Thu 2014-11-27 15:03:24 CST; 13s ago
Docs: http://docs.docker.io
Process: 4559 ExecStart=/usr/bin/docker -d OPTIONS DOCKER_STORAGE_OPTIONS (code=exited, status=1/FAILURE)
Main PID: 4559 (code=exited, status=1/FAILURE)

Nov 27 15:03:24 localhost.localdomain systemd[1]: docker.service: main proces…
Nov 27 15:03:24 localhost.localdomain systemd[1]: Failed to start Docker Appl…
Nov 27 15:03:24 localhost.localdomain systemd[1]: Unit docker.service entered…
Nov 27 15:03:24 localhost.localdomain systemd[1]: docker.service holdoff time…
Nov 27 15:03:24 localhost.localdomain systemd[1]: Stopping Docker Application…
Nov 27 15:03:24 localhost.localdomain systemd[1]: Starting Docker Application…
Nov 27 15:03:24 localhost.localdomain systemd[1]: docker.service start reques…
Nov 27 15:03:24 localhost.localdomain systemd[1]: Failed to start Docker Appl…
Nov 27 15:03:24 localhost.localdomain systemd[1]: Unit docker.service entered…
Hint: Some lines were ellipsized, use -l to show in full.

步步惊心啊,都是坑

解决办法:参考
https://segmentfault.com/q/1010000002392472这篇文章最后一条建议,修改selinux级别,然后reboot。ok搞定。
在这个过程中发现其他解决方案,不知是否有效:
1. http://www.cnblogs.com/amoyzhu/p/5261393.html
2. http://www.jixuege.com/?id=49&utm_source=tuicool&utm_medium=referral
3. http://www.centoscn.com/image-text/config/2015/0718/5877.html?spm=5176.ask1832.yqaskinfo1.13.QTDRz1

参考资料

  1. https://mos.meituan.com/library/26/how-to-install-docker-on-centos/
  2. http://wiki.jikexueyuan.com/project/docker-technology-and-combat/pull.html

你可能感兴趣的:(centos,docker,阿里云,安装配置)