[Sandbox] container2wasm
Application contact emails
Project Summary
A tool to run containers on Wasm-enabled environments.
Project Description
WebAssembly (Wasm) is expanding its adoption among tools and programming languages. But porting existing applications to Wasm is still hard. Wasm doesn't provide Linux compatibility so developers need to re-compile or re-implement existing Linux applications to run them on Wasm. This costs extra time for development.
container2wasm is a tool to solve this problem by enabling to run unmodified Linux-based containers on Wasm, leveraging CPU emulators. Applications can leverage the portability and security benefits of Wasm, without extra costs of re-compilation and re-implementation.
It has features including the following.
- Converting a container image to a wasm blob.
- Pulling unmodified OCI container image to the browser and running it inside the browser
- Supports browsers and WASI runtimes as the execution environment
- Supports networking
This project is beneficial for use cases that require an isolated execution environment and wide portability covering browsers. For example, the possible use cases will include running on-browser Linux-compatible dev environment (e.g. vscode-container-wasm), on-browser demo of applications (e.g. container2wasm demo) and isolated execution of untrusted third party software on machine.
The goal of this project is to make containers easily leverage Wasm's portability and security benefits and to make Wasm VM a more easy-to-use execution environment.
Org repo URL (provide if all repos under the org are in scope of the application)
N/A
Project repo URL in scope of application
https://github.com/ktock/container2wasm
Additional repos in scope of the application
No response
Website URL
https://github.com/ktock/container2wasm
Roadmap
https://github.com/ktock/container2wasm/blob/main/ROADMAP.md
Roadmap context
No response
Contributing Guide
https://github.com/ktock/container2wasm/blob/main/CONTRIBUTING.md
Code of Conduct (CoC)
https://github.com/ktock/container2wasm/blob/main/CODE_OF_CONDUCT.md
Adopters
No response
Contributing or Sponsoring Org
No response
Maintainers file
https://github.com/ktock/container2wasm/blob/main/MAINTAINERS
IP Policy
- [X] If the project is accepted, I agree the project will follow the CNCF IP Policy
Trademark and accounts
- [X] If the project is accepted, I agree to donate all project trademarks and accounts to the CNCF
Why CNCF?
CNCF hosts Wasm-related projects and is a large community for discussing Wasm technology. By joining CNCF, this project will be a neutral community for the discussion of the migration of applications to Wasm and encourage the integration and collaboration of containers and Wasm. This project also fills the missing piece of the ecosystem in this area.
Joining CNCF will also help this project to increase its visibility, and we expect to acquire more contributors and maintainers to this project and expand its adoption. This will help us to maintain this project in the long term.
Benefit to the Landscape
The solution for the incompatibility between the container and Wasm was a missing piece in the CNCF projects. One of the benefits of this project is that this project will fill this gap and encourage integration of containers and Wasm.
As mentioned in the project description, this project is beneficial for use cases that require isolated execution environment and wide portability covering browsers. For example, the possible use cases will include running on-browser Linux-compatible dev environments, on-browser playgrounds and isolated execution of untrusted third-party software.
Cloud Native 'Fit'
container2wasm is already listed as one of the "Wasm Orchestration & Management" tools in the landscape. https://landscape.cncf.io/?item=wasm--orchestration-management--container2wasm
container2wasm works as a runtime for containers to run in Wasm VM. So this can be classified as TAG Runtime.
Cloud Native 'Integration'
This depends on containerd of CNCF and runc of OCI for running containers. container2wasm also can be used in combination with the various tools in the CNCF community, including the following:
- Wasm blobs converted from containers can run on Wasm runtimes including WasmEdge of CNCF.
- container2wasm also supports fetching OCI container images to the browser, from the OCI-compliant registries including Harbor and Distribution(Container registry) of CNCF.
- To create a smaller Wasm image, it's good to prepare a minimal container image e.g. using CNCF SlimToolkit.
Cloud Native Overlap
No
Similar projects
-
There are container runtimes can run Wasm blobs, but they can't run containers on Wasm VM.
- Docker+Wasm integration: https://docs.docker.com/desktop/wasm/
- runwasi: https://github.com/containerd/runwasi
- youki: https://github.com/containers/youki
- crun: https://github.com/containers/crun
- krustlet: https://github.com/krustlet/krustlet
-
There are emulators that can run Linux on Wasm, but they don't support container to Wasm conversion.
- v86: https://github.com/copy/v86
- TinyEMU: https://bellard.org/tinyemu/
Landscape
Yes. https://landscape.cncf.io/?item=wasm--orchestration-management--container2wasm
Business Product or Service to Project separation
N/A
Project presentations
container2wasm hasn't been presented at any TAG meeting but it has been presented at several events including the following:
- Cloud Native Wasm Day (KubeCon NA 2023 Co-located Event) : Running Linux-Based Containers on Wasm and Browser with Container2wasm Converter - Kohei Tokunaga, NTT (YouTube: https://youtu.be/AQ_tg_78jqA?feature=shared)
- Open Source Summit North America 2024: Fetching and Running Container Images on Browsers - Kohei Tokunaga, NTT Corporation
Project champions
No response
Additional information
In the community, several adopters of container2wasm can be found.
- container4container2wasm is a tool that provides a workflow to convert Docker images to WebAssembly (WASM) modules.
- Taubyte uses container2wasm for creating spin(an embeddable WebAssembly container runtime).
- And several projects that runs applications on Wasm using container2wasm can be found on GitHub: https://github.com/search?q=container2wasm&type=repositories