Skip to content

fix(docker): build stamp shows v<version> (<commit>), not vmain#272

Merged
BorisTyshkevich merged 1 commit into
mainfrom
fix/docker-build-stamp
Jul 17, 2026
Merged

fix(docker): build stamp shows v<version> (<commit>), not vmain#272
BorisTyshkevich merged 1 commit into
mainfrom
fix/docker-build-stamp

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

Problem

The container's in-app build stamp read vmain instead of the usual v0.5.0 (6b360e8). Two causes:

  1. The Docker build context ships no .git, so build.mjs buildStamp() couldn't git rev-parse the commit → fell back to version-only.
  2. docker.yml passed ASB_VERSION=${{ steps.meta.outputs.version }} which is the branch name (main) on branch pushes.

Fix

  • build/build.mjs — when git is unavailable, fall back to $ASB_COMMIT (shortened to 7 chars) for the commit part. Local builds still prefer git (with -dirty).
  • Dockerfile — add ARG/ENV ASB_COMMIT.
  • .github/workflows/docker.yml — pass ASB_COMMIT=${{ github.sha }} and drop ASB_VERSION, so the version comes from package.json → stamp reads v<version> (<short-sha>) (e.g. v0.5.0 (6b360e8)). On a release tag, package.json already equals the tag, so it stays consistent.

Verified

docker build --build-arg ASB_COMMIT=6b360e8… . → served /sql stamp = v0.5.0 (6b360e8).

🤖 Generated with Claude Code

The Docker build context ships no .git, so build.mjs's buildStamp() couldn't
read the commit and fell back to version-only; docker.yml also passed
ASB_VERSION=<branch> (e.g. "main"), so the in-app stamp read "vmain".

- build.mjs: when git is unavailable, fall back to $ASB_COMMIT (shortened to
  7 chars) for the commit part.
- Dockerfile: add ARG/ENV ASB_COMMIT.
- docker.yml: pass ASB_COMMIT=${{ github.sha }} and drop ASB_VERSION so the
  version comes from package.json → stamp reads e.g. `v0.5.0 (6b360e8)`.

Verified locally: `docker build --build-arg ASB_COMMIT=6b360e8… ` → served
stamp `v0.5.0 (6b360e8)`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvjXR2rzh6v5EBUzBbsvFV
@BorisTyshkevich
BorisTyshkevich merged commit 10dfb88 into main Jul 17, 2026
8 checks passed
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