build: migrate from Dapper to single-Dockerfile build system#128
Open
bk201 wants to merge 7 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the repository’s build workflow from a Dapper-driven model to a single root-level Dockerfile with per-target build stages, with Makefile targets orchestrating the workflow and enabling BuildKit caching.
Changes:
- Replaced Dapper-based Make targets with
docker build --target …stages (plus local--outputextraction where needed). - Added a root
Dockerfileimplementing build/test/validate/generate stages with BuildKit cache mounts. - Updated
scripts/versionto support.git-less builds via a pre-generatedscripts/.version_env, and removed Dapper entrypoint/orchestration scripts.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/version |
Adds .git-availability guard and writes/loads scripts/.version_env for container builds. |
scripts/release |
Removed legacy Dapper release wrapper. |
scripts/entry |
Removed legacy Dapper entrypoint. |
scripts/default |
Removed legacy Dapper default orchestration. |
scripts/ci |
Removed legacy Dapper CI orchestration. |
Makefile |
New Dockerfile-stage driven build/test/validate/generate/package targets. |
Dockerfile.dapper |
Removed Dapper build image definition. |
Dockerfile |
New multi-stage build defining build/test/validate/generate targets and local outputs. |
.gitignore |
Ignores generated scripts/.version_env. |
.dockerignore |
Expands ignores (including .git) while keeping /bin available for packaging contexts. |
Comments suppressed due to low confidence (1)
scripts/version:26
- After verifying git availability with
git -C "${TOP_DIR}" ..., the script runs subsequentgit status,git rev-parse, andgit tagcommands without-C "${TOP_DIR}". Ifscripts/versionis sourced/executed from outside the repo directory, those commands will operate on the caller’s CWD and can fail or produce wrong values even though${TOP_DIR}is correct. Usinggit -C "${TOP_DIR}"consistently for all git commands would make the script location-independent.
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
fi
COMMIT=$(git rev-parse --short HEAD)
GIT_TAG=$(git tag -l --contains HEAD | head -n 1)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| DOCKER_BUILD = docker build \ | ||
| --progress=$(MK_DOCKER_PROGRESS) \ | ||
| --build-arg MK_REPO_ID \ | ||
| --build-arg MK_HOST_ARCH \ |
| if [[ -f "${_VERSION_ENV}" ]]; then | ||
| # shellcheck source=/dev/null | ||
| source "${_VERSION_ENV}" | ||
| return 0 2>/dev/null || true |
|
This pull request is now in conflict. Could you fix it @bk201? 🙏 |
- Replace the Dapper-driven Makefile (download + run .dapper binary) with a docker build --target workflow. - One Dockerfile at the repo root defines a stage per target (build, test, validate, validate-ci, generate, - generate-manifest) with BuildKit cache mounts for the Go module and build caches. - Host-side targets (package, package-webhook) continue to run docker buildx build directly. - Orchestration scripts (ci, default, entry, release) are deleted and replaced by Makefile targets that sequence the individual stages. - scripts/version gains a git-availability guard and writes scripts/.version_env so container builds and git worktree checkouts Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
The variable is used in CI workflows to push images to a temp registry. Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
Co-authored-by: Cooper Tseng <cooper.tseng@suse.com> Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
Co-authored-by: Cooper Tseng <cooper.tseng@suse.com> Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
bk201
commented
Jun 5, 2026
| # syntax=docker/dockerfile:1 | ||
| # check=skip=InvalidDefaultArgInFrom | ||
|
|
||
| FROM registry.suse.com/bci/golang:1.26 AS builder |
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
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.
Problem:
migrate from Dapper to single-Dockerfile build system
Solution:
docker build --target workflow.
validate, validate-ci, generate,
caches.
build directly.
by Makefile targets that sequence the individual stages.
so container builds and git worktree checkouts
Related Issue(s):
harvester/harvester#10604
Test plan:
Additional documentation or context