Introduce environmental variable handling to kraft build
and kraft run
#787
Labels
kind/enhancement
New feature or request
priority/medium
Issue which is important, but KraftKit is usable without it also.
Feature request summary
This issue tracks allowing the parsing and passing of environmental variables from
kraft build
andkraft run
via the command-line flag-e
flag and anenv
element in theKraftfile
specification such that these key-values are correctly passed intoposix-environ
In the case of
kraft build
, these can be statically set at compile-time such that these variables are persistent with the unikernel.In the case of
kraft run
, they are passed viauklibparam
via the syntax and requiring the KConfig optionCONFIG_LIBPOSIX_ENVIRON_LIBPARAM
:When no key is provided, for example
kraft run -e HOME
, the value should be automatically determined from the host environment viaos.Getenv
.A new wrapper library should be introduced in
unikraft/export/v0/posix-environ
to accommodate handling the list of key-value environmental variables and the correct format to be used when instantiating the VM.To statically serialize environmental variables, a new top-level
env
element should be added to theKraftfile
specification such that these are passed in the same way tokraft build
andkraft run
.Map form:
List form:
Describe alternatives
No response
Related architectures
None
Related platforms
None
Additional context
See posix-environ: Handling Environmental Variables for additional details.
The text was updated successfully, but these errors were encountered: