📚 Context
The CLI build command uses Docker to build the root filesystem of the user application, by following the steps below:
-
application defines a Dockerfile that builds as the final image of a multi-stage build a RISC-V runtime image containing the application code and whatever it need to work. Docker RISC-V support through QEMU emulation helps a lot because it avoids having to deal with cross-compilation to RISC-V, which is very convenient.
-
a docker is created using docker container create and exported using docker container export, which create a .tar file with the filesystem contents.
-
tar is then used to "cleanup" the .tar created by Docker, and remove files which may lead to irreproducibility.
-
A .ext2 drive is created from the .tar file
-
A Cartesi machine is created using the .ext2 file and other files like the Linux kernel. Machine is booted until it yields for the first time, then saved to a snapshot.
✔️ Solution
There will be more alternatives to build the application root filesystem after the VirtIO support is released.
Users will be able to interactively use the Cartesi machine, including network connectivity and host file system access, for prototyping and also for building the resulting root filesystem.
We need to start exploring these alternatives after that is available.
📈 Subtasks
🎯 Definition of Done
Issue copied from sunodo/sunodo#366
📚 Context
The CLI build command uses Docker to build the root filesystem of the user application, by following the steps below:
application defines a Dockerfile that builds as the final image of a multi-stage build a RISC-V runtime image containing the application code and whatever it need to work. Docker RISC-V support through QEMU emulation helps a lot because it avoids having to deal with cross-compilation to RISC-V, which is very convenient.
a docker is created using
docker container createand exported usingdocker container export, which create a.tarfile with the filesystem contents.taris then used to "cleanup" the.tarcreated by Docker, and remove files which may lead to irreproducibility.A
.ext2drive is created from the.tarfileA Cartesi machine is created using the
.ext2file and other files like the Linux kernel. Machine is booted until it yields for the first time, then saved to a snapshot.✔️ Solution
There will be more alternatives to build the application root filesystem after the VirtIO support is released.
Users will be able to interactively use the Cartesi machine, including network connectivity and host file system access, for prototyping and also for building the resulting root filesystem.
We need to start exploring these alternatives after that is available.
📈 Subtasks
🎯 Definition of Done