No description
- Dockerfile 93.2%
- Rust 6.8%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| src | ||
| .containerignore | ||
| .gitignore | ||
| Cargo.toml | ||
| Containerfile | ||
| README.md | ||
oci-example
Minimal Rust → OCI container image pipeline using Forgejo Actions and buildah.
Builds a statically-linked musl binary into a scratch-based image via a multi-stage Containerfile with cargo-chef for layer caching.
push → Forgejo Actions → buildah bud → oci-example:latest
Structure
├── .forgejo/workflows/publish.yaml # CI workflow (trigger: push to main)
├── Containerfile # Multi-stage OCI build (4 stages)
├── Cargo.toml / src/main.rs # Rust app (hello world stub)
Usage
Push to main – Forgejo runs the workflow automatically.
Or build locally:
buildah bud -t oci-example:latest .
docker run --rm oci-example:latest
Why musl + scratch
- musl (
x86_64-unknown-linux-musl) → fully static binary, no libc dependency - scratch base → image contains only the binary (~5 MB)
Next steps
- Add
buildah pushto publish to a registry (e.g. Forgejo's built-in container registry) - Replace the hello-world stub with your actual service (port 3000 is exposed)