Skip to content

docker version reports the engine's commit and build time - #33

Merged
chandarith-chea merged 2 commits into
mainfrom
stamp-engine-version
Nov 14, 2026
Merged

chandarith-chea merged 2 commits into
mainfrom
stamp-engine-version

Conversation

@chandarith-chea

Copy link
Copy Markdown
Contributor

Problem

docker version couldn't tell engine builds apart. /version returned GitCommit "preview", no build time, and only a dockivad component, so the CLI's Engine section showed blank Go version, commit and build date:

 Engine:
  Version:          0.18.0
  API version:      1.45 (minimum version 1.24)
  Go version:
  Git commit:
  Built:

Fix

go build already records the commit in the binary (vcs.revision, vcs.time, vcs.modified); the shipped v0.6.9 dockivad carries af13b2b. dockivad/api.go now reads it with debug.ReadBuildInfo:

  • GitCommit: the first 12 characters of the commit, with -dirty for uncommitted changes. A build outside a git checkout reports unknown.
  • BuildTime: the commit's time, so a rebuild of the same commit reports the same value.
  • An Engine component with those details, as dockerd returns. dockivad stays the first component, because verify_dockivad.py checks Components[0].

No build script change. Version stays 0.18.0 and the API version stays 1.45.

Tested

  • go test -race ./... in dockivad: ok. TestAPIContractAndRejectedOptions now checks the commit and both components.
  • A bundle built from this branch with bundle_dockiva_engine.py: verify_dockivad.py --new-home 31/31.
  • docker version against that bundle's engine:
 Engine:
  Version:          0.18.0
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.27.2
  Git commit:       731ce0056d4f
  Built:            Sat Nov 14 02:55:50 2026
  OS/Arch:          linux/arm64
  Experimental:     true

/version said GitCommit "preview" with no build time, so docker version
could not tell engine builds apart. go build already records the commit
(vcs.revision, vcs.time, vcs.modified); dockivad now reports it: the first
12 characters of the commit, "-dirty" for uncommitted changes, and the
commit's time as BuildTime. It also returns an "Engine" component with
those details, as dockerd does, so docker version's Engine section shows
the Go version, commit and build time instead of blanks. A build outside
a git checkout reports "unknown".
verify_dockivad.py identifies the Go control plane by Components[0].
@chandarith-chea
chandarith-chea merged commit a434825 into main Nov 14, 2026
2 checks passed
@chandarith-chea
chandarith-chea deleted the stamp-engine-version branch November 14, 2026 09:03
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