3 个版本
0.1.3 | 2023年12月8日 |
---|---|
0.1.2 |
|
0.1.1 | 2023年12月6日 |
0.1.0 | 2023年11月23日 |
#198 在 #wasi
每月 33 次下载
4KB
wacker
类似于 Docker,但用于 WASM。
安装
您可以直接从发布页面下载二进制文件。
或者您可以使用 cargo
安装它
cargo install wacker
cargo install wacker-cli
入门指南
启动 wacker 守护程序
$ wackerd
[2023-11-22T07:25:31Z INFO wackerd] server listening on "/Users/user/.wacker/wacker.sock"
运行 WebAssembly 模块
$ wacker run hello.wasm
$ wacker run time.wasm
其中 hello.wasm
是一个简单的 WASM 程序,它打印出 Hello World!
并退出,而 time.wasm
是一个长时间运行的程序,它不断地打印出当前时间。
列出运行中的模块
$ wacker list
ID PATH STATUS
hello-w0AqXnf hello.wasm Finished
time-xhQVmjU time.wasm Running
获取日志
$ wacker logs hello-w0AqXnf
Hello World!
$ wacker logs -f --tail 5 time-xhQVmjU
current time: 2023-11-22 07:42:34
current time: 2023-11-22 07:42:35
current time: 2023-11-22 07:42:36
current time: 2023-11-22 07:42:37
current time: 2023-11-22 07:42:38
您还可以停止/重启/删除模块
$ wacker stop time-xhQVmjU
$ wacker restart time-xhQVmjU
$ wacker delete/rm time-xhQVmjU
wacker 命令行工具用法
$ wacker -h
wacker client
Usage: wacker <COMMAND>
Commands:
run Runs a WebAssembly module
list List running WebAssembly modules
stop Stops a WebAssembly module
restart Restart a WebAssembly module
delete Delete a WebAssembly module
logs Fetch the logs of a module
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
依赖项
~4.5–6.5MB
~107K SLoC