No description
- Go 96.4%
- Dockerfile 3.6%
- helper reads Forgejo (GITHUB_*) variables, CI_* stay as fallback - sequential tag pushes and one retry for Forgejo registry upload races - trivy: native JSON reports and HIGH/CRITICAL table instead of GitLab code quality - step outputs digest and image via GITHUB_OUTPUT - image gets node, git and bash so actions/checkout runs inside it - .forgejo/workflows/build.yml replaces .gitlab-ci.yml Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .forgejo/workflows | ||
| helper | ||
| Dockerfile | ||
| Readme.md | ||
| renovate.json | ||
Docker Build Container using buildkit
Rootless buildkit plus the build-image helper and trivy. It is the builder image behind the
reusable workflows in infra/ci-snippets, which is the normal way to use it.
Image: <forgejo host>/infra/docker-build:master
What build-image does
- writes the registry login, starts rootless
buildkitd - builds for
linux/amd64,linux/arm64and pushes<image>:<tag>and<image>:<commit sha> - writes
image-hash.txtand the step outputsdigestandimage($GITHUB_OUTPUT) - scans image and repo with trivy: native JSON reports plus a table of HIGH/CRITICAL findings in the log
Environment
Forgejo Actions values are used when no override is set. GitLab CI CI_* variables still work as fallback.
| Variable | Default (Forgejo) | Meaning |
|---|---|---|
REGISTRY |
host of GITHUB_SERVER_URL |
registry host |
REGISTRY_USER / REGISTRY_PASSWORD |
GITHUB_ACTOR / GITHUB_TOKEN |
registry login |
IMAGE_NAME |
<registry>/<lowercase GITHUB_REPOSITORY> |
image without tag |
IMAGE_TAG |
slug of the branch or tag, latest on the default branch |
tag |
DEFAULT_BRANCH |
none | branch that gets latest |
DOCKERFILE_PATH |
Dockerfile |
path relative to the checkout |
ARCHITECTURES |
amd64,arm64 |
comma separated |
IMAGE_PUSH |
true |
false builds without push |
BUILDKIT_ADDITIONAL_ARGS |
extra buildctl build arguments |
|
REGISTRY_MIRROR |
docker.io mirror for buildkit | |
GOPROXY / GOPROXY_DISABLE |
https://goproxy.jonasled.dev,direct |
passed as build arg |
TRIVY_SKIP / TRIVY_TIMEOUT |
false / 5m |
scan control |
BUILDCTL_TTY |
false |
colored progress |
Runner requirements
The job container needs a runner that allows privileged job containers (rootless buildkit needs user namespaces).
The image contains node and git so actions/checkout works inside it.
This repository
.forgejo/workflows/build.yml runs the helper tests, builds this image with kaniko (the image cannot build
itself on the first run) and creates the helper SBOM.