No description
  • Dockerfile 93.2%
  • Rust 6.8%
Find a file
Florian Pallas e32cf41a1f
All checks were successful
/ publish (push) Successful in 10m5s
add cache
2026-06-11 01:24:26 +02:00
.forgejo/workflows add cache 2026-06-11 01:24:26 +02:00
src intitialize cargo project 2026-06-11 00:10:42 +02:00
.containerignore add container ignore file 2026-06-11 01:23:22 +02:00
.gitignore intitialize cargo project 2026-06-11 00:10:42 +02:00
Cargo.toml intitialize cargo project 2026-06-11 00:10:42 +02:00
Containerfile add ci 2026-06-11 00:14:00 +02:00
README.md add readme 2026-06-11 00:20:09 +02:00

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 push to 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)