From 38d3b41bd7be541c6c69b70a713f249d39165633 Mon Sep 17 00:00:00 2001 From: Daniel Vallance Date: Tue, 7 Apr 2026 16:36:41 +0100 Subject: [PATCH] fix(examples): Various fixes for imaginary example Add rootfs configuration to the Kraftfile, which was missing previously. Increase memory passed to instance, which fixes the ENOMEM Change unikraft run/kraft cloud deploy commands to map to port 8080 which is where the imaginary server runs Signed-off-by: Daniel Vallance --- imaginary/Kraftfile | 2 ++ imaginary/README.md | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/imaginary/Kraftfile b/imaginary/Kraftfile index 426aa0c4..25a414e6 100644 --- a/imaginary/Kraftfile +++ b/imaginary/Kraftfile @@ -7,4 +7,6 @@ labels: cloud.unikraft.v1.instances/scale_to_zero.stateful: "false" cloud.unikraft.v1.instances/scale_to_zero.cooldown_time_ms: 1000 +rootfs: ./Dockerfile + cmd: ["/usr/bin/imaginary", "-p", "8080"] diff --git a/imaginary/README.md b/imaginary/README.md index 8db1d82c..6fbf4dcd 100644 --- a/imaginary/README.md +++ b/imaginary/README.md @@ -34,13 +34,13 @@ When done, invoke the following command to deploy this app on Unikraft Cloud: ```bash title="unikraft" unikraft build . --output /imaginary:latest -unikraft run --metro=fra -p 443:8088/tls+http -m 256M /imaginary:latest +unikraft run --metro=fra -p 443:8080/tls+http -m 512M /imaginary:latest ``` or ```bash title="kraft" -kraft cloud deploy -p 443:8088/tls+http -M 256M . +kraft cloud deploy -p 443:8080/tls+http -M 512M . ``` The output shows the instance address and other details: @@ -54,7 +54,7 @@ The output shows the instance address and other details: ├─────────── url: https://divine-wind-1ycjvhqs.fra.unikraft.app ├───────── image: imaginary@sha256:673834bc531038bb621266f7fd635a04e559050cbe82876df811fd4b975ea4fe ├───── boot time: 32.26 ms - ├──────── memory: 256 MiB + ├──────── memory: 512 MiB ├─────── service: divine-wind-1ycjvhqs ├── private fqdn: imaginary-mwb4y.internal ├──── private ip: 172.16.3.3 @@ -106,7 +106,7 @@ kraft cloud instance list ```ansi NAME FQDN STATE STATUS IMAGE MEMORY VCPUS ARGS BOOT TIME -imaginary-mwb4y divine-wind-1ycjvhqs.fra.unikraft.app running 54 seconds ago imaginary@sha256:673834bc531038bb621266f7... 256 MiB 1 /usr/bin/imaginary -p 8080 32262us +imaginary-mwb4y divine-wind-1ycjvhqs.fra.unikraft.app running 54 seconds ago imaginary@sha256:673834bc531038bb621266f7... 512 MiB 1 /usr/bin/imaginary -p 8080 32262us ``` When done, you can remove the instance: