Skip to content

Cloud Docker image reports engram dev instead of the release version #557

Description

@mtriggiano

What happens

The published cloud image (ghcr.io/gentleman-programming/engram:latest and the vX.Y.Z tags) reports engram dev instead of the release version:

$ docker run --rm ghcr.io/gentleman-programming/engram:v1.17.0 version
engram dev

Homebrew binaries report the version correctly (engram 1.17.0), so the gap is specific to the Docker image.

Root cause

docker/cloud/Dockerfile builds the binary without injecting the version:

RUN CGO_ENABLED=0 ... go build -o /out/engram ./cmd/engram

cmd/engram/main.go defaults var version = "dev" and only recovers a real value from -X main.version (set by goreleaser) or from debug.ReadBuildInfo(). The Docker build uses neither: it skips the ldflag, and because it compiles from a source COPY (not go install ...@vX.Y.Z), info.Main.Version resolves to (devel). So version stays dev.

.goreleaser.yaml injects the ldflag for the brew/archive artifacts, but the cloud image is built separately by .github/workflows/cloud-image.yml, which never passes the version through.

Suggested fix

Add a VERSION build arg to the Dockerfile, inject it via -ldflags "-X main.version=$VERSION", and pass steps.meta.outputs.version from the publish workflow. Small, two-file change.

Happy to send a PR (already have it ready and verified locally).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions