build: stamp the agent image with the checkout's version

The container build was the one build path that could not learn a version: the
build context excludes .git, so it has to be passed in, and nothing passed one
-- Compose handed the Dockerfile no build args, so every locally built agent
answered "dev" while the daemon reported the tag. The Taskfile now derives the
version from git describe once, for both the host binaries and the image, and
task image:agent passes it through.

docker compose build agent also failed outright: the service named the image by
digest, and Compose refuses to tag a digest. The build-only service names it by
tag now; what a task container runs is still pinned in the daemon's own
[containers] image.
This commit is contained in:
sam committed 2026-10-25 20:24:27 +11:00
1 parent 1e1a055f98
commit e8568259e8
3 files changed
+26 -7

No files matched your search

+10 -4
View File
@@ -8,7 +8,7 @@
# Embedded NATS is the normal deployment and needs no Compose service.
# State Store DB: docker compose up -d postgres
# External broker: docker compose up -d nats
# Build worker: docker compose build agent
# Build worker: task image:agent (stamps this checkout's version)
# Profile image: docker compose build agent-net
# Stop external: docker compose down
# Logs: journalctl --user -u archied -f (the daemon)
@@ -86,10 +86,16 @@ services:
build:
context: .
dockerfile: Dockerfile
# Pinned to a verified digest -- archie-agent has no published semver
# tag yet (CI only pushes :latest). See
# Stamped into the agent so the version it reports is the one the rest of
# the install reports. `task image:agent` passes this checkout's version;
# a bare `docker build` passes nothing and the agent answers dev.
args:
RUNTIME_VERSION: ${RUNTIME_VERSION:-dev}
# A tag, not the digest: Compose refuses to build an image it is told to
# name by digest. The digest a task container actually runs is pinned in
# the daemon's own [containers] image, so nothing here decides it. See
# deployments/systemd-user-service.md#pinning-the-archie-agent-image.
image: ghcr.io/samcharles93/archie-agent@sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090
image: ghcr.io/samcharles93/archie-agent:latest
# ── example agent profile image ─────────────────────────────────────
# The agent image plus network lookup tools, for a workflow that names