Build your own GitLab package


In this article, we will introduce the principles and steps of manual package building.


  1. Chef/Omnibus

    Easily create full-stack installers for your project across a variety of platforms.

    Read more:

    Demo project:

  2. gitlab-org/Omnibus

    GitLab fork of the omnibus project. Required for faster responses to issues with omnibus-gitlab.

    Merge Request Demo ( Feature Branch Flow )

  3. gitlab-org/omnibus-gitlab

    This project creates full-stack platform-specific downloadable packages for GitLab.

    Merge Request Demo ( Master Branch Flow )


Let’s show how to build a package for CentOS-8 .

According to Chef/Omnibus introduction, we know that the build script should be executed on CentOS-8 environment, and we use Docker to provide an CentOS-8 environment.

docker pull
git clone ~/omnibus-gitlab
cd ~/omnibus-gitlab
docker run -v ~/omnibus-gitlab:/omnibus-gitlab -it bash
# in docker container

export COMPILE_ASSETS=true

cd /omnibus-gitlab
bundle install
bundle binstubs --all

# The next rake  requires the git work area to be clean.
git checkout -b compile-assets-jh
git add .
git commit -m "Update Gemfile.lock"

bundle exec rake build:project

The packages will be built and available in the ~/omnibus-gitlab/pkg directory.



      # .custom_sources.yml
      remote: ""
      alternative: ""
      remote: ""
      alternative: ""
      # ...

    In file .custom_sources.yml, the repo URL of each GitLab component is listed.

    By default, remote is used, if the flag ALTERNATIVE_SOURCES=true is specified, then the build will use alternative.

    You can also use GITLAB_ALTERNATIVE_REPO to specify your own repo.

    Read more:


    Compiling frontend resources is a time-consuming step.

    And the frontend resources are cross-platform, which means that their results can be shared between various Linux release.

    Usually, this frontend compilation process is completed in the CI of the GitLab Rails project.

    1. GitLab Rails CI compile frontend resources and push compilation result;
    2. Pull compilation result and use docker -v to mount it;
    3. Set ASSET_PATH env variable in building environment.

    Read more: