Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Hall <[email protected]>
  • Loading branch information
imjasonh committed Aug 9, 2023
1 parent 190b884 commit 632c3e2
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/features/wasm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Wasm

`ko` has early **experimental** support for building wasm containers.

This currently requrires:

- `ko` built from head (`go install github.com/google/ko@main`)
- [Go 1.21](https://go.dev/dl/) or later
- [up-to-date Docker Desktop with experimental features enabled](https://docs.docker.com/desktop/wasm/)

With those requirements met, you can build a wasm container with:

```sh
ko build ./cmd/app --platform=wasip1/wasm
```

You can then run this image with:

```sh
docker run \
--runtime=io.containerd.wasmedge.v1 \
--platform=wasip1/wasm \
${IMAGE}
```

### Known Limitations

- SBOMs are not generated for containers built this way
- `--platform` must only specify `wasip1/wasm`, and no other platforms
- Test coverage is limited. [Anecdotally](https://github.com/ko-build/ko/pull/1095), the `wasmedge` and `wasmtime` runtimes should work, but `slight` and `spin` do not currently.

0 comments on commit 632c3e2

Please sign in to comment.