# Creating our own / custom foundation db builds

**URL:** https://forums.foundationdb.org/t/creating-our-own-custom-foundation-db-builds/3456
**Category:** Development
**Created:** [July 15, 2022, 5:21pm UTC](https://forums.foundationdb.org/t/creating-our-own-custom-foundation-db-builds/3456 "2022-07-15T17:21:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![harikb](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/harikb/32/1033_2.png) [@harikb](https://forums.foundationdb.org/u/harikb)
#### Post date: [July 15, 2022, 5:21pm UTC](https://forums.foundationdb.org/t/creating-our-own-custom-foundation-db-builds/3456/1 "2022-07-15T17:21:02Z")

</div>

Hello,

I have a need to build an fdb binary with azure-backup support turned on and I am following instructions in two different repos. I am looking for a confirmation if I am on the right path.

The repo [FoundationDB/fdb-build-support](https://github.com/FoundationDB/fdb-build-support) has instructions to build, but I am finding that some of the dockerfiles mentioned, such as `foundationdb/codebuild` doesn’t exist in the public Dockerhub.

Instead I do find some instructions in the [apple/foundationdb main repo](https://github.com/apple/foundationdb/tree/main/packaging/deb) to build a .deb package.

I am following a combination of instructions from both repos. Let me know if I am going down the wrong path or looking at obsolete instructions.

I appreciate your help.

Thanks

–  
Hari

---

<div class="post-metadata">

### Author: ![Imperatorx](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@Imperatorx](https://forums.foundationdb.org/u/Imperatorx)
#### Post date: [July 16, 2022, 12:07am UTC](https://forums.foundationdb.org/t/creating-our-own-custom-foundation-db-builds/3456/2 "2022-07-16T00:07:38Z")

</div>

Here is a complete working GitLab CI .gitlab-ci.yml example for building DEB packages that worked for me. You can take a look at image and sequence of commands if you use another build facility.

```auto
stages:
  - build
  - test
  - deploy

build-job:
  stage: build
  image: foundationdb/build:centos7-latest
  script:
    - git clone --depth 1 --branch 7.1.15 https://github.com/apple/foundationdb.git
    - mkdir build
    - cd build
    - source /opt/rh/devtoolset-8/enable && source /opt/rh/rh-python38/enable && cmake -DFDB_RELEASE=ON -G Ninja ../foundationdb
    - ninja -j2
    - cpack -G DEB
    - ls -laR packages
    - rm -rf packages/bin
    - rm -rf packages/*versioned*
    - rm -rf packages/*.tar.gz
    - rm -rf packages/*ddeb*
  artifacts:
    name: target
    when: always
    expire_in: 1 days
    paths:
      - build/packages

```

---

<div class="post-metadata">

### Author: ![jzhou](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/jzhou/32/445_2.png) [@jzhou](https://forums.foundationdb.org/u/jzhou)
#### Post date: [July 16, 2022, 12:19am UTC](https://forums.foundationdb.org/t/creating-our-own-custom-foundation-db-builds/3456/3 "2022-07-16T00:19:19Z")

</div>

What @Imperatorx did should work. Essentially, the build uses `foundationdb/build:centos7-latest` docker image, which is based on [fdb-build-support/Dockerfile at main · FoundationDB/fdb-build-support · GitHub](https://github.com/FoundationDB/fdb-build-support/blob/main/docker/centos7/Dockerfile).

Then inside this docker, assuming the foundationdb source repo is at `${HOME}/src/foundationdb`, then you can run either `cmk` (using gcc) or `ccmk` (using clang) to compile everything. The output will be inside `${HOME}/build_output` directory.
