Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imjasonh/wasimg
Bundle wasm modules into OCI images
https://github.com/imjasonh/wasimg
Last synced: about 1 month ago
JSON representation
Bundle wasm modules into OCI images
- Host: GitHub
- URL: https://github.com/imjasonh/wasimg
- Owner: imjasonh
- License: apache-2.0
- Created: 2022-10-13T18:36:26.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-20T16:36:23.000Z (over 1 year ago)
- Last Synced: 2024-10-14T16:50:55.402Z (3 months ago)
- Language: Go
- Size: 4.41 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `wasimg`
`wasimg` bundles a Wasm module into an OCI manifest, and pushes it to an OCI registry.
For example:
```
$ wasimg my-module.wasm example.com/my-project/my-module
example.com/my-project/my-module@sha256:a7bb950a6cf95fd1dfc55907ec997e37840c71f6840d0c32481e7b8392490022
```It doesn't require Docker or Dockerfiles, and it reuses your pre-configured registry credentials by default.
### Installation
```
go install github.com/imjasonh/wasimg@latest
```### Usage
Build a wasm module, for example, build `wasimg` itself:
```
GOOS=wasip1 GOARCH=wasm go build -o wasimg.wasm .
```If you already have a wasm module, you can skip this step.
Then use `wasimg` to bundle that wasm module and push it to a registry:
```
$ wasimg wasimg.wasm ttl.sh/wasimg
ttl.sh/wasimg@sha256:caea81fc44d4d92280a4bc7ceaccf15b3466792c312c9fa38446f73ce358ee3c
```This prints the image reference of the pushed image, which you can run:
```
$ docker run \
--runtime=io.containerd.wasmedge.v1 \
--platform=wasip1/wasm \
ttl.sh/wasimg@sha256:caea81fc44d4d92280a4bc7ceaccf15b3466792c312c9fa38446f73ce358ee3c
```Try it out to see what happens!