-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have option to specify output directory path #2036
Comments
To fix this, you'll need to add an additional option, --output (or -o), that allows users to explicitly define the output directory. This would make it easier to keep the build artifacts (.unikraft) separate from the Dockerfile's file references. Step-by-Step Plan: 1)Add a new --output or -o flag to the kraft build command. This option will specify the directory where the .unikraft output files should go. If the --output option is provided, it should be used solely for the .unikraft output directory. When parsing the Dockerfile, treat the directory where the Dockerfile resides as the base directory for any relative paths (e.g., COPY). 3)Ensure that paths inside the Dockerfile are relative to the directory specified by the --rootfs argument, but output is placed in the directory defined by --output. 4)Ensure that both the output path for .unikraft and the Dockerfile's input paths are correctly handled without any conflicts. kraft build --rootfs ./Dockerfile -K ./Kraftfile -o /path/to/output . In this example: --rootfs ./Dockerfile: Path to the Dockerfile or root filesystem. 1)Add --output Option to Command Line Parsing: var outputDir string 2)Update File Path Handling Logic: if outputDir != "" { 3)Modify Dockerfile Path Handling: // Handling Dockerfile paths 4)Final Build Logic: Ensure that the build logic respects both the Dockerfile’s input paths and the output directory: // Now, the build function should use the OutputDir separately output; You can now specify a separate output directory for the .unikraft files without affecting the base paths inside the Dockerfile. |
Thanks, @bishnushah0909 , for the input. I'll let @craciunoiuc and @nderjung comment here, as they have a better view of the source code. |
Feature request summary
Currently, when running
kraft build
, you can configure the path to theKraftfile
by using the-K
option tokraft
. You can configure the path to the root filesystem by using the--rootfs
option tokraft
.For the output directory path (the one storing the output directory
.unikraft/
), we use the last argument tokraft
(if that is not present, the current directory is used). The issue is that that last argument is also used as the base directory for paths inside aDockerfile
passed as an argument, e.g. the use ofCOPY path/to/local/file path/in/container
inside aDockerfile
. So currently we don't have an option of using a directory forDockerfile
input files and a separate one for the output directory.unikraft
.It would be useful to have an option such as
--output
/-o
to specify the output directory.Describe alternatives
No response
Related architectures
None
Related platforms
None
Additional context
We can use a command such as this to specify paths for the root filesystem /
Dockerfile
and for theKraftfile
:kraft build --plat qemu --arch x86_64 --rootfs ../Dockerfile -K ./Kraftfile ..
But we don't have an option for the output directory.
The text was updated successfully, but these errors were encountered: