在CentOS 6.4上安装Docker

来源:互联网 发布:毛笔字生成器软件 编辑:程序博客网 时间:2024/05/20 06:53

根据Docker官方文档进行安装,记录了遇到的问题。

我认为自己已经安装了epel,于是直接运行了安装命令。

yum install docker-io

报错如下:

[root@docker conf]# yum search docker-ioLoaded plugins: fastestmirror, refresh-packagekit, securityDetermining fastest mirrors * base: centos.ustc.edu.cn * epel: mirrors.yun-idc.com * extras: centos.ustc.edu.cn * updates: centos.ustc.edu.cnbase                | 3.7 kB     00:00     epel                | 3.7 kB     00:00     epel/primary_db     | 3.9 MB     00:01     extras              | 3.4 kB     00:00     google64            |  951 B     00:00     updates             | 3.4 kB     00:00     updates/primary_db  | 3.7 MB     00:00     epel/pkgtags        | 1.0 MB     00:00     Warning: No matches found for: docker-ioNo Matches found

一定是epel的问题,于是重新安装,按照这个链接安装[传送门]

问题原因:没有启用remi源。

重新搜索docker-io包,成功了。

启动一个bash shell进行测试

docker run -i -t centos /bin/bash


报错如下:

2014/07/26 03:05:27 unable to remount sys readonly: unable to mount sys as readonly max retries reached

问题原因:配置文件不正确

//from statckvoerflowyour /etc/sysconfig/docker needs to look like this:other_args="--exec-driver=lxc --selinux-enabled"otherwise it will not work.

按照上面的说明修改配置文件,重启docker,成功。

serivce docker restartdocker run -i -t centos /bin/bashbash-4.2# 



0 0
原创粉丝点击