当前位置: 首页 > backend >正文

使用docker任意系统编译opengauss

使用docker任意系统编译opengauss

本人使用开发机器为ubuntu系统,不在官方推荐的编译系统内。但是不想为了开发opengauss重装系统。所以采用docker进行编译。

  1. 代码拉取

本人是在/home/yuyang/Documents/opengauss目录下进行操作。

先获取源代码:git clone https://gitee.com/opengauss/openGauss-server.git

直接下载编译好的依赖:https://opengauss.obs.cn-south-1.myhuaweicloud.com/latest/binarylibs/gcc10.3/openGauss-third_party_binarylibs_Centos7.6_x86_64.tar.gz

下载地址见:https://gitee.com/opengauss/openGauss-server#%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E5%92%8C%E8%BD%AF%E4%BB%B6%E4%BE%9D%E8%B5%96%E8%A6%81%E6%B1%82中列表

解压后,修改文件夹名称为binarylibs

yuyang@yuyang-MS-7D97:~/Documents/opengauss$ ls
binarylibs  openGauss-server  openGauss-third_party_binarylibs_Centos7.6_x86_64.tar.gz
  1. 镜像拉取&启动

镜像拉取:

docker pull centos:centos7.6.1810

镜像启动:

docker run -itd -v /home/yuyang/Documents/opengauss:/sda --network host --name centos-test centos:centos7.6.1810 
  • 将工作目录/home/yuyang/Documents/opengauss映射到docker容器中的/sda
  • 使用host网络,需要拉取依赖
  1. 进入容器
docker exec -it centos-test bash
  1. 配置容器中镜像源

/etc/yum.repos.d/下的文件都清除,创建Centos-7.repo文件:

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/os/$basearch/https://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/https://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#released updates 
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/updates/$basearch/https://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/https://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/https://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/https://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/https://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/https://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/https://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/https://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  1. 安装依赖

官方表格中的依赖:

yum install -y libaio-devel flex bison ncurses-devel glibc-devel patch lsb_release readline-devel

同时在编译中发现还需要安装:

yum install -y make witch python3 perl
  1. 编译

进入/sda/openGauss-server目录:

sh build.sh -m debug -3rd /sda/binarylibs 

编译完成

http://www.xdnf.cn/news/739.html

相关文章:

  • Vue.js 入门教程
  • Spring 微服务解决了单体架构的哪些痛点?
  • 分布式入门
  • 七段码 路径压缩 并查集 dfs
  • 思维题专题
  • K8s-Pod详解
  • 第一讲 生成式ai是什么
  • 头歌java课程实验(函数式接口及lambda表达式)
  • 【AI论文】CLIMB:基于聚类的迭代数据混合自举语言模型预训练
  • 2026《数据结构》考研复习笔记四(第一章)
  • 单例模式与消费者生产者模型,以及线程池的基本认识与模拟实现
  • Java学习手册:Filter 和 Listener
  • synchronized 与分布式锁
  • 约束:常见约束(常见约束-例子,外键约束)
  • Laravel-vite+vue开发前端模板
  • 最新扣子空间实操指南
  • QML--全局对象Qt
  • 1.Vue自动化工具安装(Vue-cli)
  • 自定义请求头导致跨域的解决办法
  • C++学习:六个月从基础到就业——内存管理:RAII原则
  • 键入网址到网页显示,期间发生了什么?
  • Arduino示例代码讲解:Project 08 - Digital Hourglass 数字沙漏
  • DAY 50 leetcode 1047--栈和队列.删除字符串中的所有相邻重复项
  • Spring MVC 如何体现 Model-View-Controller 各自的职责?它们之间是如何协作的?
  • 【Linux】进程状态
  • 【仓颉 + 鸿蒙 + AI Agent】CangjieMagic框架(17):PlanReactExecutor
  • OpenCV 自适应背景更新 cv2.accumulateWeighted
  • 【OC】AVPlayerLayer的学习
  • PG psql --single-transaction 参数功能
  • 秘密任务 3.0:如何通过 JWT 认证确保 WebSockets 安全