Skip to content

Bake main as the default footer branch in Docker#33

Merged
mre merged 1 commit into
mainfrom
bake-git-branch
Jun 21, 2026
Merged

Bake main as the default footer branch in Docker#33
mre merged 1 commit into
mainfrom
bake-git-branch

Conversation

@mre

@mre mre commented Jun 21, 2026

Copy link
Copy Markdown
Member

Follow-up to the footer wiring. The previous version left GIT_BRANCH defaulting to "unknown" in the image unless you set a Coolify build arg.

Since prod only ever deploys main, this just defaults ARG GIT_BRANCH=main in the Dockerfile, so the branch is baked into every image with no Coolify config. It's still overridable with --build-arg GIT_BRANCH=... for a one-off branch build. The commit hash continues to come from Coolify's auto-injected SOURCE_COMMIT (no config needed).

Verified in a real docker build: passing --build-arg GIT_BRANCH=dockerbranchtest --build-arg SOURCE_COMMIT=deadbeefcafe1234 bakes dockerbranchtest and deadbee into the server binary, so the footer reads <branch> @ <hash>.

Production only deploys main, so default ARG GIT_BRANCH=main. The image
now bakes the branch with no Coolify config (overridable per-branch via
--build-arg). Verified in a real docker build that the branch and the
shortened SOURCE_COMMIT land in the server binary.
@mre mre merged commit bbda6b3 into main Jun 21, 2026
4 checks passed
@mre mre deleted the bake-git-branch branch June 21, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant