-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jason Hall <[email protected]>
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |