Docker 在Centos 6.5 X64下安装
下载epel
wget http://ftp.sjtu.edu.cn/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
安装epel
rpm -ivh epel-release-6-8.noarch.rpm
安装docker-io
yum -y install docker-io
启动docker进程
service docker start
如果我们需要开机自启动,如下:
chkconfig docker on
报错解决
INFO[0000] +job serveapi(unix:///var/run/docker.sock)
INFO[0000] WARNING: You are running linux kernel version 2.6.32-431.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.8.0.
docker: relocation error: docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference
[root@oracledb ~]# yum upgrade device-mapper-libs
解决办法:
执行:yum upgrade device-mapper-libs
查看版本;
docker version
测试工作是否正常,获取最新的centos镜像
docker pull centos:latest
获取完成后,确保通过如下命令可以看到镜像:
$ sudo docker images centos
输出信息如下:
[root@oracledb ~]# docker images centos
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
centos latest dade6cb4530a 2 weeks ago 224 MB
运行简单的bash shell来测试这个镜像
$ sudo docker run -i -t centos /bin/bash
如果正常,会获得一个简单的bash提示,输入exit退出
查看IP
ip a
[root@453689dcd74c /]# ip a
4: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
5: eth0: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.2/16 scope global eth0
inet6 fe80::42:acff:fe11:2/64 scope link
查看版本
cat /etc/centos-release
如下:
[root@453689dcd74c /]# cat /etc/centos-rel
更多精彩内容请关注:http://bbs.superwu.cn
关注超人学院微信二维码:
原文地址:http://blog.csdn.net/crxy2014/article/details/46428047