Skip to content

MUL-2375 fix(docker): pass VERSION, COMMIT, DATE build args to docker build#2715

Open
sapk wants to merge 3 commits into
multica-ai:mainfrom
sapk-fork:fix/docker-build-args
Open

MUL-2375 fix(docker): pass VERSION, COMMIT, DATE build args to docker build#2715
sapk wants to merge 3 commits into
multica-ai:mainfrom
sapk-fork:fix/docker-build-args

Conversation

@sapk
Copy link
Copy Markdown

@sapk sapk commented May 16, 2026

What does this PR do?

Forward Makefile build variables (VERSION, COMMIT, DATE) to Docker builds so that binaries inside Docker images report accurate version information instead of hardcoded defaults (dev/unknown).

Currently, docker-compose.selfhost.build.yml builds the backend image without passing any build args, so the resulting multica and server binaries fall back to version=dev and commit=unknown. The Makefile already computes these values from git metadata.

Add ARG DATE=unknown to the Dockerfile and pass -X main.date= in the multica binary ldflags similar to make build.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Refactor / code improvement (no behavior change)
  • Documentation update
  • Tests (adding or improving test coverage)
  • CI / infrastructure

Changes Made

  • Dockerfile — Added ARG DATE=unknown and -X main.date=${DATE} to the multica build ldflags (matching the Makefile build target pattern)
  • docker-compose.selfhost.build.yml — Added args: block to the backend service build config, forwarding VERSION, COMMIT, and DATE from the environment (which the Makefile export already sets)

How to Test

  1. Build via Makefile: make selfhost-build
  2. Verify the binary version inside the image:
    docker run --rm --entrypoint=/app/multica multica-backend:dev version
    Should output a real version (e.g. v0.2.20 or v0.0.0-20260516083000-abc123def456), not dev.
  3. Verify without Makefile (manual):
    export VERSION=$(git describe --tags --dirty 2>/dev/null || echo dev)
    export COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo unknown)
    export DATE=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
    docker compose -f docker-compose.selfhost.yml -f docker-compose.selfhost.build.yml up -d --build
    docker run --rm --entrypoint=/app/multica multica-backend:dev version

Checklist

  • I have included a thinking path that traces from project context to this change
  • I have run tests locally and they pass
  • N/A — I have added or updated tests where applicable
  • N/A — If this change affects the UI, I have included before/after screenshots
  • N/A — I have updated relevant documentation to reflect my changes
  • N/A — If I added a new runtime / coding tool / UI tab, I synced the change to landing copy (apps/web/features/landing/i18n/), starter-content (packages/views/onboarding/utils/starter-content-content-*.ts), and relevant docs (apps/docs/content/docs/)
  • N/A — If this PR touches Chinese product copy, I checked it against apps/docs/content/docs/developers/conventions.zh.mdx (terminology, mixed-rule for task / issue / skill)
  • I have considered and documented any risks above
  • I will address all reviewer comments before requesting merge

AI Disclosure

AI tool used: Claude Code, Multica Agent

Prompt / approach:
Simply ask claude to create an issue in multica to fix version and pass already existing variable from Makefile to docker build.

Add build args to docker-compose.selfhost.build.yml so the Makefile
variables (VERSION, COMMIT, DATE) are forwarded to the Docker build.
Add ARG DATE=unknown to the Dockerfile and pass -X main.date=
in the multica binary ldflags. This ensures docker-built binaries
report proper version info instead of falling back to "dev".
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

@sapk is attempting to deploy a commit to the IndexLabs Team on Vercel.

A member of the Team first needs to authorize it.

@multica-eve multica-eve changed the title fix(docker): pass VERSION, COMMIT, DATE build args to docker build MUL-2375 fix(docker): pass VERSION, COMMIT, DATE build args to docker build May 18, 2026
@sapk sapk force-pushed the fix/docker-build-args branch from 433b48a to 097aaf5 Compare May 23, 2026 22:01
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.

2 participants