build: replace Dapper with single-Dockerfile build system#26
Open
bk201 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR replaces the previous Dapper-based build workflow with a Docker BuildKit, single-Dockerfile build pipeline driven directly by the project Makefile, and updates version/package scripts to work when .git isn’t available in the Docker build context.
Changes:
- Added a multi-stage
Dockerfileimplementing build, test, validate, and validate-ci stages with BuildKit cache mounts. - Rewrote the
Makefileto run build/test/validate targets viadocker buildtargets and to run packaging scripts host-side. - Updated
scripts/versionto support a.git-less build context via a generatedscripts/.version_env, and adjusted ignore rules accordingly.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/version |
Adds .version_env fallback for builds without .git and updates host arch detection. |
scripts/package |
Removes Dapper-era packaging wrapper script. |
scripts/entry |
Removes Dapper entrypoint script. |
scripts/ci |
Removes Dapper-era CI wrapper script. |
Makefile |
Replaces Dapper invocation with direct Docker BuildKit build/test/validate targets and host-side package targets. |
Dockerfile.dapper |
Removes the legacy Dapper build image definition. |
Dockerfile |
Introduces multi-stage BuildKit Dockerfile for build, validate, validate-ci, and test. |
.gitignore |
Ignores generated scripts/.version_env and normalizes .idea/. |
.dockerignore |
Excludes .git from context and adjusts ignore set for the new Docker-based build flow. |
Comments suppressed due to low confidence (1)
scripts/version:25
- scripts/version computes TOP_DIR and uses
git -C "${TOP_DIR}" ...for the initial availability check, but subsequent git commands run without-C. If the script is sourced/executed from a different working directory, those commands may operate on the wrong repo or fail despite TOP_DIR being known. Use-C "${TOP_DIR}"consistently.
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
fi
COMMIT=$(git rev-parse --short HEAD)
GIT_TAG=${DRONE_TAG:-$(git tag -l --contains HEAD | head -n 1)}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+9
to
+18
| if ! git -C "${TOP_DIR}" rev-parse HEAD &>/dev/null 2>&1; then | ||
| if [[ -f "${_VERSION_ENV}" ]]; then | ||
| # shellcheck source=/dev/null | ||
| source "${_VERSION_ENV}" | ||
| return 0 2>/dev/null || true | ||
| fi | ||
| echo "ERROR: git is unavailable and no pre-generated scripts/.version_env was found." >&2 | ||
| echo "Run 'scripts/version' (or 'make gen-version-env') on a host with git access first." >&2 | ||
| return 1 2>/dev/null || exit 1 | ||
| fi |
Remove the Dapper-based build setup and replace it with a Docker BuildKit single-Dockerfile approach driven directly from the Makefile. Changes: - Add Dockerfile with builder, base, build/build-output, validate, validate-ci and test stages; BuildKit cache mounts scoped per repo via MK_REPO_ID - Rewrite Makefile: drop Dapper download logic; add DOCKER_BUILD, MK_HOST_ARCH, MK_REPO_ID, MK_DOCKER_PROGRESS, MK_DOCKER_RUN_OPTS_TTY, BANNER and per-target rules (build, test, validate, validate-ci, package, gen-version-env, clean, clean-all) - Delete Dockerfile.dapper and orchestration scripts (ci, entry, package); package_lvmplugin, package_lvm_provisioner and package_lvm_webhook are now invoked as host-side targets directly from the Makefile - Update scripts/version: add git-unavailable fallback that reads/writes scripts/.version_env so container builds and git worktree checkouts work without access to .git; replace `go env GOHOSTARCH` with `uname -m | sed ...` so the script runs on hosts without Go installed - Update .dockerignore: exclude .git (stages needing git use git-init); keep /bin visible for package Dockerfiles - Add scripts/.version_env to .gitignore Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
Vicente-Cheng
approved these changes
Jun 10, 2026
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.
Remove the Dapper-based build setup and replace it with a Docker BuildKit single-Dockerfile approach driven directly from the Makefile.
Changes:
go env GOHOSTARCHwithuname -m | sed ...so the script runs on hosts without Go installedRelated Issue(s):
harvester/harvester#10622