Closed tacryt-socryp closed 1 month ago
I can confirm this issue, even with helloworld-c
.
This might to be an issue with the rootfs
. Changing cmd
from ["/helloworld"]
to ["/fallback"]
successfully runs the fallback app from base/Kraftfile
, which should not be there.
This does not seem to be a KraftKit issue, since I can reproduce this all the way back to KraftKit v0.8.0
.
It might be an issue with the prebuilt base
image, but I don't know if you can test older versions.
To reproduce:
export KRAFTKIT_LOG_LEVEL=debug
export KRAFTKIT_LOG_TYPE=basic
cd examples/helloworld-c
kraft run --rm --plat qemu --arch x86_64 -p 8080:8080 .
It does not work without -p 8080:8080
, which is another issue, I guess.
One workaround is building base
manually and working directly on base
:
export KRAFTKIT_LOG_LEVEL=debug
export KRAFTKIT_LOG_TYPE=basic
cd library/base
kraft build --plat qemu --arch x86_64
kraft run --rm --plat qemu --arch x86_64 -p 8080:8080 .
So this may be a KraftKit issue after all (combining different rootfs
'), but I am not sure. This workaround will suffice for me for now.
Another workaround is setting base
's Unikraft version to 0.17.0
:
--- a/library/base/Kraftfile
+++ b/library/base/Kraftfile
@@ -9,7 +9,7 @@ rootfs: ./Dockerfile
cmd: ["/fallback"]
unikraft:
- version: staging
+ version: 0.17.0
kconfig:
# Configurations options for app-elfloader
# (they can't be part of the template atm)
You can then build your custom base
(library/base
):
kraft build --plat qemu --arch x86_64
kraft pkg --as oci --name my-base:latest
Using this custom base should work, then (examples/helloworld-c
):
--- a/examples/helloworld-c/Kraftfile
+++ b/examples/helloworld-c/Kraftfile
@@ -1,6 +1,6 @@
spec: v0.6
-runtime: base:latest
+runtime: my-base:latest
rootfs: ./Dockerfile
kraft run --rm --plat qemu --arch x86_64 -p 8080:8080 .
The root cause of this is detailed on the unikraft
core repository issue tracker. It is caused by an issue with enabling dead code elimination on a recent update to the uklibparam
library.
This was solved by unikraft
PR 1499.
This output is from http-c, but all of the examples provide the same issue: