feat(asm-runner): docker image - #8
Conversation
Two-stage build: Ubuntu 24.04 with the pinned Rust toolchain compiles the binary, slim Ubuntu 24.04 runtime ships it. ENTRYPOINT/CMD default to /app/config.toml and /app/asm-params.json; no params validation in the entrypoint, so misconfiguration surfaces as a runtime failure from the binary itself (same as launching the runner directly). Native and "no prover" modes are supported out of the box because the NativeHost backend is compiled in unconditionally. SP1 mode needs --features sp1 and the guest ELFs bundled into the image — left as a TODO(prover-sp1) inside the Dockerfile with the concrete steps for adding it.
The original Dockerfile only built a native/no-prover image and left SP1 support as a TODO. Fold SP1 in now via a second build target so both variants ship from the same Dockerfile. Structure: shared `builder` stage parameterized by a `CARGO_FEATURES` build-arg, a `runtime-base` stage with the binary, then `native` (default, no extras) and `sp1` (copies pre-built guest ELFs into /app/elfs/) targets. Guest ELFs are built outside docker and staged into `docker/asm-runner/artifacts/elfs/` rather than built inside an SP1 image, matching alpen's `docker/strata/Dockerfile` pattern. Building inside would need either docker-in-docker (for sp1-build's docker-build feature) or the full SP1 toolchain in the builder layer — both heavier than just copying ELFs in from the host/CI runner.
🔒 AI Security ReviewScope: Finding 1: Runtime container runs as root (no File: None of the runtime stages set a Exploit scenario: Fix: Add a dedicated non-root user/group in Apply this in Other areas checked, no issues found
No other exploitable vulnerabilities were found in this diff. |
Description
Adds a Docker flow for
strata-asm-runner. Single two-stage Dockerfile underdocker/asm-runner/: Ubuntu 24.04 builder with the pinned Rust toolchain (rust-toolchain.toml) compiles the binary, slim Ubuntu 24.04 runtime ships it.ENTRYPOINT/CMDdefault to/app/config.tomland/app/asm-params.json; both are overridable via flags or volume mounts. No params validation in the entrypoint — misconfiguration surfaces as a runtime failure from the binary itself.Native prover and the "no prover" mode work out of the box because the
NativeHostbackend is compiled in unconditionally. SP1 mode is not supported by this image — it's marked asTODO(prover-sp1)in the Dockerfile (with the concrete steps) and will land in a follow-up PR using the alpen pattern (pre-built guest ELFs staged into the build context).No docker CI workflow: the workspace compile is already covered by
unit.yml/functional.yml. Adding a docker-builds-too job duplicated that signal at significant CI cost.Type of Change
Notes to Reviewers
Verified locally:
docker buildx buildsucceeds anddocker run --rm strata-asm-runner:latest --helpprints the expected CLI usage. Final image is ~150 MB total / ~40 MB content.Checklist