• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
导航菜单
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx
您的位置:首页 > 服务器 >云计算 > centos源码编译docker,centos源码docker

centos源码编译docker,centos源码docker

作者:网友 字体:[增加 减小] 来源:互联网

本文主要包含centos6.5安装docker,centos6安装docker,centos 7 安装docker,centos下安装docker,centos安装docker等服务器相关知识,网友希望可以进行参考

centos源码编译docker,centos源码docker


安装golang centos7 直接安装golang
yum install golang
centos6需添加软件源,然后再安装
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
yum install golang

安装依赖包
yum groupinstall 'Development tools'
yum install glibc-static ?sqlite-devel.x86_64 libselinux-static libsepol-static
yum install libuuid-devel libattr-devel zlib-devel libacl-devel e2fsprogs-devel libblkid-devel lzo-devel  asciidoc xmlto

编译device mapper
git clone --no-checkout https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2 && cd /usr/local/lvm2 && git checkout -q v2_02_103  
#如果下载超时,使用https://github.com/steven676/lvm2.git代替,或直接从https://git.fedorahosted.org/cgit/lvm2.git/refs/tags下载
cd /usr/local/lvm2 && ./configure --enable-static_link && make  && make install
此处要注意别用./configure --enable-static_link && make device-mapper && make install_device-mapper只编译device mapper,这样有可能因为lvm与device mapper不匹配,而导致lvm无法运行,在物理机下次重启时,所有lvm文件系统都不可用,只能重装操作系统了。

编译安装sqlite
wget http://www.sqlite.org/2015/sqlite-autoconf-3080803.tar.gz
./configure
make
make install

安装btrfs-progs centos7
yum install btrfs-progs
centos6
git clone git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git 
cd btrfs-progs
./autogen.sh 
./configure
make
make install

设置环境变量
export GOPATH=/path/to/go   #docker目录放在/path/to/go/docker
export AUTO_GOPATH=1

编译docker
静态编译
 ./hack/make.sh binary




动态编译docker
./hack/make.sh dynbinary



TroubleShooting
  •  执行lvm --version出错:
lvm: relocation error: lvm: symbol dm_get_status_cache, version Base not defined in file libdevmapper.so.1.02 with link time reference
这是由于之更新了device mapper,没有更新lvm导致,直接运行:
cd /usr/local/lvm2 && ./configure --enable-udev_sync && make && make install

  • 启动docker时报如下警告
 level="warning" msg="WARNING: Udev sync is not supported. This will lead to unexpected behavior, data loss and errors"
原因在于编译device mapper时没有添加对 udev sync的支持,执行如下命令重新编译:
yum install libudev-devel
cd /usr/local/lvm2 && ./configure --enable-udev_sync && make && make install
cd docker && ./hack/make.sh dynbinary  
由于现在udev没有可用静态库,所以只能编译device mapper的动态链接库,也就只能编译动态链接版的docker。

  • centos7编译device mapper出错,错误信息如下,未解决,求助?
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(seusers.o): In function `getseuserbyname':
(.text+0x334): warning: Using 'getgrouplist' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(seusers.o): In function `getseuserbyname':
(.text+0x306): warning: Using 'getgrnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(seusers.o): In function `getseuserbyname':
(.text+0x570): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(load_policy.o): In function `selinux_mkload_policy':
(.text+0x302): undefined reference to `lzma_stream_decoder'
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(load_policy.o): In function `selinux_mkload_policy':
(.text+0x411): undefined reference to `lzma_code'
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(load_policy.o): In function `selinux_mkload_policy':
(.text+0x482): undefined reference to `lzma_end'
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(load_policy.o): In function `selinux_mkload_policy':
(.text+0x642): undefined reference to `lzma_end'
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(label_file.o): In function `closef':
(.text+0x136): undefined reference to `pcre_free'
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(label_file.o): In function `closef':
(.text+0x13f): undefined reference to `pcre_free_study'
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(label_file.o): In function `compile_regex.isra.5':
(.text+0x270): undefined reference to `pcre_compile'
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(label_file.o): In function `compile_regex.isra.5':
(.text+0x291): undefined reference to `pcre_study'
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(label_file.o): In function `lookup':
(.text+0x4fa): undefined reference to `pcre_exec'
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libselinux.a(label_file.o): In function `lookup':
(.text+0x572): undefined reference to `pcre_exec'
collect2: error: ld returned 1 exit status
make[1]: *** [dmsetup.static] Error 1
make[1]: Leaving directory `/root/lvm2-2_02_103/tools'
make: *** [tools.device-mapper] Error 2


  • 静态编译版的docker在启动时出错(动态编译版运行正常),信息如下,未解决,求助。
# /root/go/docker/bundles/1.4.1-dev/binary/docker-1.4.1-dev -H unix:///var/run/docker.sock -H tcp://0.0.0.0:5050 -d -g /home/docker/  --bridge="" --group=""
INFO[0000] +job serveapi(unix:///var/run/docker.sock, tcp://0.0.0.0:5050) 
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. 
WARN[0000] WARNING: Udev sync is not supported. This will lead to unexpected behavior, data loss and errors 
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) 
INFO[0000] Listening for HTTP on tcp (0.0.0.0:5050)     
INFO[0000] /!\ DON'T BIND ON ANOTHER IP ADDRESS THAN 127.0.0.1 IF YOU DON'T KNOW WHAT YOU'RE DOING /!\ 
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x0 pc=0x0]


runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x988759
runtime.throw(0x12bdce5)
/usr/lib/golang/src/pkg/runtime/panic.c:520 +0x69
runtime: unexpected return pc for runtime.sigpanic called from 0x988759
runtime.sigpanic()
/usr/lib/golang/src/pkg/runtime/os_linux.c:222 +0x3d


goroutine 24 [syscall]:
runtime.cgocall(0x402028, 0xc208399038)
/usr/lib/golang/src/pkg/runtime/cgocall.c:143 +0xe5 fp=0xc208399020 sp=0xc208398fd8
github.com/docker/docker/pkg/devicemapper._Cfunc_dm_udev_wait(0x0, 0xc2085970c0)
github.com/docker/docker/pkg/devicemapper/_obj/_cgo_de
分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • centos源码编译docker,centos源码docker

相关文章

  • <转>云主机配置OpenStack使用spice的方法,openstackspice
  • 通过 Web Service 调用Pentaho BI 的API,pentahobi
  • 万法归宗之Hadoop编程无界限,万法归宗hadoop
  • Hadoop之——HBase笔记,hadoophbase
  • 首届中国大数据技术沙龙会议邀请函,首届沙龙
  • Spark RDD API扩展开发(1),sparkrdd
  • Mahout的BreimanExample例子分析,mahoutexample
  • Sqoop工具,sqoop安装
  • hadoop文件损坏解决办法,
  • MapReduce编程之实现多表关联,mapreduce编程关联

文章分类

  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx

最近更新的内容

    • 家,我日夜思念的名字,我回来了,
    • inet_ntoa issue,inet_ntoa
    • Andrew Ng机器学习课程9-补充,andrew9-
    • spark core源码分析8 从简单例子看transformation,transformation
    • 从Hadoop URL中读取数据,hadoopurl读取数据
    • MapReduce编程之倒排索引,mapreduce编程索引
    • 在Ubuntu下安装Mongdb,以及Mongdb基本操作命令,ubuntumongdb
    • 超级权限容器,权限容器
    • 万法归宗之Hadoop编程无界限,万法归宗hadoop
    • 配置KVM虚拟机的网络,Bridge和Nat方式,kvmnat

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有