Skip to content

fix(docker): accept commit and tag as build args (RIG-10145) - #28

Merged
rigel-nemo[bot] merged 1 commit into
rigel-releasefrom
nebula/rig-10145-accept-commit-and-tag-as-build-args
Nov 19, 2026
Merged

rigel-nemo[bot] merged 1 commit into
rigel-releasefrom
nebula/rig-10145-accept-commit-and-tag-as-build-args

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Nov 19, 2026 •

Copy link
Copy Markdown

What does this do

Declares ARG CI_COMMIT_SHA CI_COMMIT_TAG in the build stage of docker/Dockerfile. These are the build args publish-image already passes, so the image build can name its version.

Why do we need it

The build context has no .git. The Makefile's CI_COMMIT_SHA ?= $(shell git rev-parse HEAD) fallback then yields nothing, and the version comes out as next-. Undeclared build args are dropped, so publish-image could not reach make.

This matches nebula#70 (forks/autoscaler/docker/Dockerfile, commit 97743a97) line for line, so the next fork import matches.

Summary

  • Add ARG CI_COMMIT_SHA CI_COMMIT_TAG after ARG TARGETOS TARGETARCH. make build is unchanged.

Verification

Run on mattpc-wsl (macpro2013 was overloaded, load 206):

  • make build CI_COMMIT_SHA=abc123 CI_COMMIT_TAG=1.5.0-rigel.5: rc 0, --version prints autoscaler version 1.5.0-rigel.5.
  • make build CI_COMMIT_SHA=abc123: rc 0, --version prints autoscaler version next-abc123.
  • make build with both variables unset: rc 0, --version prints autoscaler version next-, the same value as before this change.
  • podman build --build-arg CI_COMMIT_SHA=abc123 -f docker/Dockerfile .: rc 0. podman run --rm <image> --version prints autoscaler version next-abc123, rc 0.

Docker's info fails on mattpc-wsl (shim), so the image build used podman.

Risks

Unset behaviour is unchanged. An unset ARG exports an empty variable, and CI_COMMIT_SHA ?= treats an empty value as set, so the git fallback is skipped. That matches the behaviour before this change, which also gave next-.

Refs RIG-10145

Co-authored-by: Matt Wilkinson matt@rigel.build

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Nov 19, 2026

Copy link
Copy Markdown

RIG-10145

@rigel-mintaka

Copy link
Copy Markdown
Author

Review round 1 at 80eba3d199dcf99f342d3b1572efa4aaa6d20913: no findings.

  • Diff: one line, ARG CI_COMMIT_SHA CI_COMMIT_TAG, in the build stage before make build. The file is byte-identical to the nebula import's copy.
  • Image check: a podman build from a tarball with no .git, using CI_COMMIT_TAG=1.5.0-rigel.5, then --version, prints autoscaler version 1.5.0-rigel.5 (rc 0).
  • Unset case: with the build args unset, the output is unchanged (next-).

@rigel-mintaka

Copy link
Copy Markdown
Author

All-clear at 80eba3d

Independent review, round 1: no findings.

@rigel-nemo

rigel-nemo Bot commented Nov 19, 2026

Copy link
Copy Markdown

Checks read:

@rigel-nemo
rigel-nemo Bot merged commit 9dcab51 into rigel-release Nov 19, 2026
2 of 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