Skip to content

Commit e7fd8a9

Browse files
committed
feat: add stapeln.toml layer-based container definition\n\nConverted from existing Containerfile to stapeln format.\nIncludes Chainguard base, security hardening, SBOM generation.\n\nCo-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9dde789 commit e7fd8a9

1 file changed

Lines changed: 88 additions & 0 deletions

File tree

stapeln.toml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# stapeln.toml — Layer-based container build for valence-shell
3+
#
4+
# stapeln builds containers as composable layers (German: "to stack").
5+
# Each layer is independently cacheable, verifiable, and signable.
6+
7+
[metadata]
8+
name = "valence-shell"
9+
version = "0.1.0"
10+
description = "valence-shell container service"
11+
author = "Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>"
12+
license = "PMPL-1.0-or-later"
13+
registry = "ghcr.io/hyperpolymath"
14+
15+
[build]
16+
containerfile = "Containerfile"
17+
context = "."
18+
runtime = "podman"
19+
20+
# ── Layer Definitions ──────────────────────────────────────────
21+
22+
[layers.base]
23+
description = "Chainguard Wolfi minimal base"
24+
from = "cgr.dev/chainguard/wolfi-base:latest"
25+
cache = true
26+
verify = true
27+
28+
[layers.toolchain]
29+
description = "Build tools"
30+
extends = "base"
31+
packages = []
32+
cache = true
33+
34+
[layers.build]
35+
description = "valence-shell build"
36+
extends = "toolchain"
37+
commands = ["dnf update -y && dnf install -y \", "curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain leanprover/lean4:stable", "dnf install -y agda || echo "Agda not available in dnf, skipping""]
38+
39+
[layers.runtime]
40+
description = "Minimal runtime"
41+
from = "cgr.dev/chainguard/wolfi-base:latest"
42+
packages = ["ca-certificates", "curl"]
43+
copy-from = [
44+
{ layer = "build", src = "/app/", dst = "/app/" },
45+
]
46+
entrypoint = ["["/entrypoint.sh"]"]
47+
user = "valence-shell"
48+
env = { PATH = "/root/.elan/bin:${PATH}" }
49+
50+
# ── Security ───────────────────────────────────────────────────
51+
52+
[security]
53+
non-root = true
54+
read-only-root = false
55+
no-new-privileges = true
56+
cap-drop = ["ALL"]
57+
seccomp-profile = "default"
58+
59+
[security.signing]
60+
algorithm = "ML-DSA-87"
61+
provider = "cerro-torre"
62+
63+
[security.sbom]
64+
format = "spdx-json"
65+
output = "sbom.spdx.json"
66+
include-deps = true
67+
68+
# ── Verification ───────────────────────────────────────────────
69+
70+
[verify]
71+
vordr = true
72+
svalinn = true
73+
scan-on-build = true
74+
fail-on = ["critical", "high"]
75+
76+
# ── Targets ────────────────────────────────────────────────────
77+
78+
[targets.development]
79+
layers = ["base", "toolchain", "build"]
80+
env = { LOG_LEVEL = "debug" }
81+
82+
[targets.production]
83+
layers = ["runtime"]
84+
env = { LOG_LEVEL = "info" }
85+
86+
[targets.test]
87+
layers = ["base", "toolchain", "build"]
88+
env = { LOG_LEVEL = "debug" }

0 commit comments

Comments
 (0)