Skip to content

feat(examples): Add wazero1.12-go1.27-base-distroless example - #347

Open
danieldyn wants to merge 2 commits into
unikraft:mainfrom
danieldyn:feat/add-wazero1.12-go1.27-base-distroless
Open

danieldyn wants to merge 2 commits into
unikraft:mainfrom
danieldyn:feat/add-wazero1.12-go1.27-base-distroless

Conversation

@danieldyn

Copy link
Copy Markdown

Description

Added a Wazero1.12 Go1.27 WebAssembly polyglot example using the distroless container image gcr.io/distroless/static-debian13, which is compatible with trixie and provides sufficient dependencies.

The README.md file contains instructions for building and running the example manually.

The multi-stage Docker build handles the compilation of all 5 languages into .wasm files and drops them alongside the static Go /runner binary in the bare distroless container image.

Automated Testing

The second commit of this PR contains a three-stage workflow to build and test this example via Github Actions:

  1. Measuring the rootfs size (resulting in 21MB)
  2. Scanning for vulnerabilities using Trivy (one found, but not relevant, see .trivyignore for more)
  3. Running and validating output using grep

Notes

While Go and Rust needed their respective compilers from the Docker images golang:1.27.0-trixie and rust:1.98-trixie, C and C++ can benefit from Zig's fully configured Clang frontend (zig cc and zig c++ as compilation commands for WebAssembly).

Use static-debian13 distroless image for full compatibility
with trixie builds. It provides a bare filesystem for the
multi-stage docker build.

Additionally, use SHA digest for distroless image.

Signed-off-by: Daniel-Ioan Dinu <daniel_dinu30@yahoo.com>
…ample

- Measure root file system size using du -h
- Scan for vulnerabilities using Trivy
- Run and validate output using grep

Additionally, document one unresolved CVE to .trivyignore.

Signed-off-by: Daniel-Ioan Dinu <daniel_dinu30@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant