Repository navigation
fix(docker): accept commit and tag as build args (RIG-10145) - #28
Merged
rigel-nemo[bot] merged 1 commit intoNov 19, 2026
Merged
rigel-nemo[bot] merged 1 commit into
rigel-nemo[bot] merged 1 commit into
Conversation
Co-authored-by: Matt Wilkinson <matt@rigel.build>
Author
|
Review round 1 at
|
Author
|
All-clear at 80eba3d Independent review, round 1: no findings. |
|
Checks read:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this do
Declares
ARG CI_COMMIT_SHA CI_COMMIT_TAGin the build stage ofdocker/Dockerfile. These are the build argspublish-imagealready passes, so the image build can name its version.Why do we need it
The build context has no
.git. The Makefile'sCI_COMMIT_SHA ?= $(shell git rev-parse HEAD)fallback then yields nothing, and the version comes out asnext-. Undeclared build args are dropped, sopublish-imagecould not reachmake.This matches nebula#70 (
forks/autoscaler/docker/Dockerfile, commit97743a97) line for line, so the next fork import matches.Summary
ARG CI_COMMIT_SHA CI_COMMIT_TAGafterARG TARGETOS TARGETARCH.make buildis 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,--versionprintsautoscaler version 1.5.0-rigel.5.make build CI_COMMIT_SHA=abc123: rc 0,--versionprintsautoscaler version next-abc123.make buildwith both variables unset: rc 0,--versionprintsautoscaler 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> --versionprintsautoscaler version next-abc123, rc 0.Docker's
infofails on mattpc-wsl (shim), so the image build used podman.Risks
Unset behaviour is unchanged. An unset
ARGexports an empty variable, andCI_COMMIT_SHA ?=treats an empty value as set, so the git fallback is skipped. That matches the behaviour before this change, which also gavenext-.Refs RIG-10145
Co-authored-by: Matt Wilkinson matt@rigel.build