Skip to content

fix(builder): Allow custom dockerfile names when building#322

Open
craciunoiuc wants to merge 1 commit into
stagingfrom
craciunoiuc/use-exact-dockerfile-name
Open

fix(builder): Allow custom dockerfile names when building#322
craciunoiuc wants to merge 1 commit into
stagingfrom
craciunoiuc/use-exact-dockerfile-name

Conversation

@craciunoiuc
Copy link
Copy Markdown
Member

@craciunoiuc craciunoiuc commented May 12, 2026

Previously, the name was cut from the path, so it used the default 'Dockerfile' name breaking functionality.

Depends on: unikraft-cloud/x#253
Merged

Closes: TOOL-855

TODOs left:
* Bump the library after merging
* Update the golden files for tests when they start behaving

@craciunoiuc craciunoiuc requested a review from jedevc May 12, 2026 12:16
@craciunoiuc craciunoiuc force-pushed the craciunoiuc/use-exact-dockerfile-name branch from c271649 to 6b04c57 Compare May 12, 2026 12:42
@jedevc
Copy link
Copy Markdown
Member

jedevc commented May 14, 2026

This shouldn't be merged as is, it should use the kraftfile dockerfile property.

@craciunoiuc
Copy link
Copy Markdown
Member Author

correct

@craciunoiuc craciunoiuc marked this pull request as draft May 14, 2026 09:23
@craciunoiuc craciunoiuc force-pushed the craciunoiuc/use-exact-dockerfile-name branch from 6b04c57 to 689c4aa Compare May 14, 2026 16:03
@craciunoiuc craciunoiuc force-pushed the craciunoiuc/use-exact-dockerfile-name branch 2 times, most recently from 6be6327 to f0080e3 Compare May 22, 2026 11:03
@craciunoiuc craciunoiuc requested a review from Copilot May 22, 2026 11:04
@craciunoiuc craciunoiuc force-pushed the craciunoiuc/use-exact-dockerfile-name branch from f0080e3 to 5aa4479 Compare May 22, 2026 11:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the build pipeline to support building rootfs images from Dockerfiles with non-default filenames by introducing an explicit Rootfs.Dockerfile field, wiring it through Kraftfile parsing, and passing the correct BuildKit frontend attributes for Dockerfile selection.

Changes:

  • Add FSOpts.Dockerfile and plumb it from Kraftfile (rootfs.source.dockerfile) into builder options.
  • Update BuildKit LocalDirs/frontend attrs so the Dockerfile frontend can be pointed at a custom filename.
  • Add integration/E2E test coverage for building with a custom Dockerfile name and bump unikraft.com/x/kraftfile.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/builder/rootfs.go Adjusts Dockerfile build context wiring to BuildKit; updates dockerfile-path validation/error messages.
internal/builder/rootfs_test.go Adds integration test for custom Dockerfile filename builds.
internal/builder/kraftfile.go Adapts to new kraftfile FSSource shape and propagates dockerfile to BuildOpts.
internal/builder/kraftfile_test.go Updates tests for new kraftfile source structure and adds dockerfile-field cases.
internal/builder/build.go Extends FSOpts with a Dockerfile field.
cmd/unikraft/integration/build_test.go Adds end-to-end test for rootfs.source.dockerfile in Kraftfile.
go.mod / go.sum Bumps unikraft.com/x/kraftfile dependency and updates sums.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/builder/rootfs.go
Comment thread internal/builder/rootfs.go
Comment thread internal/builder/rootfs.go
Comment thread internal/builder/kraftfile.go Outdated
@craciunoiuc craciunoiuc force-pushed the craciunoiuc/use-exact-dockerfile-name branch 2 times, most recently from 0f1f7c0 to 5bdc9d2 Compare May 22, 2026 11:42
@craciunoiuc craciunoiuc marked this pull request as ready for review May 22, 2026 11:43
Previously, the name was cut from the path, so it used the default
'Dockerfile' name breaking functionality.

This is fixed in the `x/kraftfile` bump.

The dockerfile needs to be in a subfolder in the context.

Signed-off-by: Cezar Craciunoiu <cezar@unikraft.io>
@craciunoiuc craciunoiuc force-pushed the craciunoiuc/use-exact-dockerfile-name branch from 5bdc9d2 to 6cc644d Compare May 25, 2026 12:06
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.

3 participants