spinframework / spinframework/spin

Support for running Spin Applications built inside a container

Open
#2,285 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/oci
Dominant language
Rust
Stars
6.5k
Forks
310
Avg merge
1d 20h
Merged PRs (30d)
24

Description

It is often valuable to have reproducible build environments for applications that work across systems. This is especially true when doing continuous integration or working in teams with mixed operating systems.

Spin supports OCI artifacts for distributing applications - but not OCI containers. This means that you can't re-use existing build environments for broadly compatible Spin applications. An exception exists here - the Spin containerd shim supports regular containers too in some cases. Which means for a new tinygo application you can build a container like:

FROM --platform=${BUILDPLATFORM} tinygo/tinygo:0.30.0 AS build
WORKDIR /opt/build

COPY go.mod go.sum .
RUN go mod download
COPY . .
RUN tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go

FROM scratch
COPY --from=build /opt/build/main.wasm .
COPY --from=build /opt/build/spin.toml .

But this is unsupported by Spin proper (and also Fermyon Cloud).

Currently you can't effectively work around this even by running the compiler in a container as you lose build provenance, but also rely on the host spin implementation to build the OCI artifact while pushing.

Ideally we implement support similar to that in the shim to enable easier integration into existing build and release engineering practices.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the existing containerd shim behavior for regular containers and Spin's current OCI artifact build and push flow. Define how container-built applications retain build provenance and remain usable by Spin proper and release workflows; done means container-built Spin applications are supported without relying on the host implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, wasm
Domain
build-system, cli, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.