Summary
Evaluate using OCI container images as build environments for language compilation, eliminating the need for local toolchain installation.
Motivation
Instead of requiring users to install TinyGo, .NET SDK, or other toolchains locally, we could leverage container images that have these toolchains pre-installed.
Proposed Approach
- Pull toolchain image - e.g.,
docker.io/tinygo/tinygo:0.32.0
- Mount source code - Bind mount project directory into container
- Execute build - Run build commands inside container
- Extract artifacts - Copy compiled WASM out of container
Available Toolchain Images
| Language |
Image |
Notes |
| Go |
tinygo/tinygo |
Official TinyGo images |
| C#/.NET |
mcr.microsoft.com/dotnet/sdk |
Official .NET SDK |
| Rust |
rust:latest + cargo-component |
Would need custom image |
Implementation Options
bollard crate - Rust Docker API client
- Shell to CLI - Call
docker or podman directly
- containerd integration - Direct containerd API
Trade-offs
Pros
- No local toolchain installation required
- Consistent, reproducible build environments
- Toolchain versioning via image tags
- Works across all platforms with Docker/Podman
Cons
- Requires Docker or Podman installed
- Container startup overhead on each build
- More complex implementation
- Disk space for cached images
Questions to Answer
- Is Docker/Podman a reasonable dependency for Fabricks users?
- Should this be opt-in or the default build method?
- How do we handle offline scenarios?
- Should we provide our own curated toolchain images?
Related
Summary
Evaluate using OCI container images as build environments for language compilation, eliminating the need for local toolchain installation.
Motivation
Instead of requiring users to install TinyGo, .NET SDK, or other toolchains locally, we could leverage container images that have these toolchains pre-installed.
Proposed Approach
docker.io/tinygo/tinygo:0.32.0Available Toolchain Images
tinygo/tinygomcr.microsoft.com/dotnet/sdkrust:latest+ cargo-componentImplementation Options
bollardcrate - Rust Docker API clientdockerorpodmandirectlyTrade-offs
Pros
Cons
Questions to Answer
Related