unikraft / kraftkit

Build and use highly customized and ultra-lightweight unikernel VMs.
https://unikraft.org/docs/cli
BSD 3-Clause "New" or "Revised" License
203 stars 61 forks source link

fix(initrd): Correctly propagate workdir to dockerfile #1696

Closed LucaSeri closed 2 weeks ago

LucaSeri commented 3 weeks ago

Prerequisite checklist

Description of changes

Commit 5cb57adbb0cf81fbc59ce69761c31fbe186030d5 reworked the way the workdir is passed to different initrd implementation. This ended up in having a duplicate workdir entry in the dockerfile initrd type. Changes take into account that with the new implementation, the path of the dockerfile is relative to the workdir.

This change ultimately solves an issue related to kraftkit not being able to find the dockerfile when building outside the cwd:

$ kraft build ../scss/redis/
<!> building rootfs                                                                                                                                                                                                                                               x86_64 [2.8s]
 i  creating ephemeral buildkit container
 i  #1 [internal] load build definition from Dockerfile
 i  #1 transferring dockerfile: 2B done
 i  #1 DONE 0.0s
 E  could not wait for err group: could not solve: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory