8

Docker+Wasm Reaches Technical Preview 2, Includes Three New Runtime Engines

 1 year ago
source link: https://www.infoq.com/news/2023/03/docker-wasm-containers-preview-2/?itm_source=infoq&itm_medium=popular_widget&itm_campaign=popular_content_list&itm_content=
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Docker+Wasm Reaches Technical Preview 2, Includes Three New Runtime Engines

Mar 25, 2023 1 min read

Docker has announced the second technical preview of Docker+Wasm, aiming to make it easier to run Wasm workloads and extending runtime support by including Fermyon's spin, Deislabs' slight, and Bytecode Alliance's wasmtime runtime engines.

The three new Wasm engines in Docker+Wasm bring the total number of supported runtimes to four, including WasmEdge, which was already supported in Docker+Wasm technical preview 1. All of them are based on the runwasi library, which recently joined the containerd project.

runwasi is a Rust library that enables running wasm workloads managed through containerd, thus effectively creating the abstraction of a new container type in addition to the Linux container originally supported by containerd. Runwasi, as its name implies, is based on WASI, a modular system interface for WebAssembly providing a common platform for Wasm runtimes. This means that if a program is compiled to target WASI, it can be run on any WASI-compliant runtime.

A Wasm container typically only includes a compiled Wasm bytecode file, without requiring any additional binary libraries, which makes it much smaller. This also implies a Wasm container is usually much faster to startup and more portable than Linux containers. For example, as WasmEdge co-founder Michael Yuan noted on Twitter, while a "slim" Python container image for Linux is over 40MB, its Wasm container counterpart takes less than 7MB.

Being Wasm containers directly supported by containerd, in order to try out Docker+Wasm technical preview 2 in Docker Desktop's latest release, the only required thing is enabling the "Use containerd" option under Settings > Features in development.

To run a Wasm container using wasmtime, you can then execute:

$ docker run --rm --runtime=io.containerd.wasmtime.v1 
--platform=wasi/wasm secondstate/rust-example-hello:latest

Thanks to this, Wasm containers can be run side by side with Linux containers using Docker Compose or other orchestration platforms such as Kubernetes. Additionally, Docker Desktop is able to package a Wasm app into an OCI container by embedding a Wasm runtime in it to enable to share it through a container registry such as DockerHub and others.

About the Author

Sergio De Simone

Sergio De Simone is a software engineer. Sergio has been working as a software engineer for over fifteen years across a range of different projects and companies, including such different work environments as Siemens, HP, and small startups. For the last few years, his focus has been on development for mobile platforms and related technologies. He is currently working for BigML, Inc., where he leads iOS and OS X development.

Show more

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK