centos6.2 64 部署docker

简介: centos6.2 64 部署docker安装docker yum源:yum install http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.

centos6.2 64 部署docker


安装docker yum源:

yum install http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm


[root@yz6245 yum.repos.d]#  yum install docker-io

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again


解决:

修改repo:https 改为http

yum install docker-io


# docker  version

Client version: 1.7.1

Client API version: 1.19

Go version (client): go1.4.2

Git commit (client): 786b29d/1.7.1

OS/Arch (client): linux/amd64

Get http:///var/run/docker.sock/v1.19/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?




service docker start

启动成功

#service docker start 这里等价于docker -d 


docker -d  有报错:

[root@yz6245 yum.repos.d]# docker  -d

WARN[0000] You are running linux kernel version 2.6.32-220.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.10.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



解决:

yum install device-mapper-libs

安装成功后还是同样错误,对比在centos6.5上部署的环境,发现device-mapper-libs版本低,故进行了手动rpm安装。

升级高版本后解决。

依赖包:

yum install libudev-devel.x86_64




wget http://mirrors.163.com/centos/6/os/x86_64/Packages/device-mapper-1.02.117-7.el6.x86_64.rpm            

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/device-mapper-devel-1.02.117-7.el6.i686.rpm        

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/device-mapper-devel-1.02.117-7.el6.x86_64.rpm      

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/device-mapper-event-1.02.117-7.el6.x86_64.rpm      

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/device-mapper-event-devel-1.02.117-7.el6.i686.rpm  

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/device-mapper-event-devel-1.02.117-7.el6.x86_64

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/device-mapper-event-libs-1.02.117-7.el6.i686.rpm   

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/device-mapper-event-libs-1.02.117-7.el6.x86_64.rpm 

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/device-mapper-libs-1.02.117-7.el6.i686.rpm         

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/device-mapper-libs-1.02.117-7.el6.x86_64.rpm  


 

 

[root@yz6245 device-mapper]# service docker restart 

Stopping docker:                                           [FAILED]

Starting docker:                                   [  OK  ]

[root@yz6245 device-mapper]# docker -d

WARN[0000] You are running linux kernel version 2.6.32-220.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.10.0. 

INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) 

ERRO[0000] [graphdriver] prior storage driver "devicemapper" failed: Error running DeviceCreate (CreatePool) dm_task_run failed 

FATA[0000] Error starting daemon: error initializing graphdriver: Error running DeviceCreate (CreatePool) dm_task_run failed 


还是报错,网上说可能是磁盘空间问题,发现没有异常。

[root@yz6245 device-mapper]# 

[root@yz6245 device-mapper]# df

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/sda1             41284736   7586236  31601360  20% /

tmpfs                  1896576         0   1896576   0% /dev/shm

/dev/vda1            309627260    195416 293703700   1% /data0

[root@yz6245 device-mapper]# ll /var/lib/docker/

total 8

drwx------ 4 root root 4096 Sep 22 20:17 devicemapper

drwx------ 2 root root 4096 Sep 22 19:27 tmp

[root@yz6245 device-mapper]# rm -rf  /var/lib/docker/*

[root@yz6245 device-mapper]# service docker restart 

Stopping docker:                                           [FAILED]

Starting docker:                                   [  OK  ]

[root@yz6245 device-mapper]# docker -d

WARN[0000] You are running linux kernel version 2.6.32-220.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.10.0. 

ERRO[0000] [graphdriver] prior storage driver "devicemapper" failed: Error running DeviceCreate (CreatePool) dm_task_run failed 

FATA[0000] Error starting daemon: error initializing graphdriver: Error running DeviceCreate (CreatePool) dm_task_run failed 




-s 是指定使用的文件系统,默认是devicemapper 也可以是vfs 或aufs(ubuntu的)

**  启动docker-daemon不成功,可能是我的线上机器是虚拟机的问题所以加上 -s vfs 就启动成功了。**


#如果要追加参数请修改/etc/sysconfig/docker 这个文件 如:加入other_args=" -s vfs"




[root@yz6245 device-mapper]# docker -d -s vfs 

WARN[0000] You are running linux kernel version 2.6.32-220.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.10.0. 

INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) 

WARN[0000] Running modprobe bridge nf_nat failed with message: , error: exit status 1 

WARN[0000] Your kernel does not support oom control.    

INFO[0000] Loading containers: start.                   


INFO[0000] Loading containers: done.                    

INFO[0000] Daemon has completed initialization          

INFO[0000] Docker daemon                                 commit=786b29d/1.7.1 ex




#到目前为止已经能正常pull镜像,但是无法正常运行container。

[root@yz6245 ~]# docker  images

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

commonms/ansible    latest              b3e0a9dd686a        2 days ago          469.2 MB

[root@yz6245 ~]# docker  run -i -t  commonms/ansible  /bin/bash

...

...

一直卡住不动。待解决。

目录
相关文章
|
6月前
|
Docker 容器
CentOS7.3 安装 docker
CentOS7.3 安装 docker
71 0
|
7月前
|
Linux Shell 开发工具
CentOS8中Docker安装及部署
CentOS8中Docker安装及部署
684 0
|
弹性计算 Linux Apache
部署并使用Docker(CentOS 8)
本场景带您体验如何在Centos 8.5 64位操作系统的云服务器上部署并使用Docker。
|
缓存 Linux Docker
Centos安装docker
Centos安装docker
372 0
|
Linux 应用服务中间件 nginx
Docker在Centos上的安装
Docker是一个划时代开源项目,使用Docker让应用的部署、测试和发布都变得十分便捷。 不论是应用开发人员、运维人员、还是其他的技术人员都有必要认识和掌握Docker,节约资源。本系列以Docker实战为主,具体Docker的定义名称请自行进行百度查找。
194 0
|
Linux Docker 容器
【docker】构建自己的CentOS
【docker】构建自己的CentOS
|
Linux Docker 容器
|
Linux Docker 容器
CentOS 7下安装docker
CentOS 7下安装docker
335 0
CentOS 7下安装docker
|
Shell Linux Docker
最新 Docker 基于centos7.x 的安装
最新 Docker 基于centos7.x 的安装
155 0
最新 Docker 基于centos7.x 的安装