Drone build limit workaround¶
The Drone CI server typically enforces a 5000 build limit, requiring a manual build process to bypass this restriction^[400-devops-04-ci-cd-pipelines-drone.md]. This limitation can be removed by compiling the Drone server binary from source using specific build tags.
Compilation methods¶
Go build commands¶
The most direct method involves using the go build command with specific tags to disable the limit^[400-devops-04-ci-cd-pipelines-drone.md].
- Open Source Edition:
go build -tags "oss nolimit" github.com/drone/drone/cmd/drone-server - Enterprise Edition:
bash go build -tags "nolimit" github.com/drone/drone/cmd/drone-server^[400-devops-04-ci-cd-pipelines-drone.md]
Dockerfile build¶
For containerized deployments, a Dockerfile can be used to compile an unrestricted version of Drone CI^[400-devops-04-ci-cd-pipelines-drone.md]. This process involves a multi-stage build:
- Builder Stage: Uses
golang:1.18-alpineto compile the source code. It fetches the specified version (e.g.,2.15.0), downloads dependencies, and executes the build command with the-tags="nolimit"flag^[400-devops-04-ci-cd-pipelines-drone.md]. - Final Image: Copies the compiled binary from the builder stage into a clean
alpine:3.16image, configuring environment variables for database, runner, and server settings^[400-devops-04-ci-cd-pipelines-drone.md].
The example provided builds image yudady/drone:2.15.0 using the command:
docker build -t yudady/drone:2.15.0 .^[400-devops-04-ci-cd-pipelines-drone.md]
Prerequisites¶
To perform the compilation, the following environment is required^[400-devops-04-ci-cd-pipelines-drone.md]:
* Go 1.11 or later with Go modules enabled.
* Build tools (specifically build-base for Alpine environments).
* Access to the Drone source code repository.
Related Concepts¶
- [[Docker]]
- CI/CD
Sources¶
^[400-devops-04-ci-cd-pipelines-drone.md]