11# SPDX-License-Identifier: PMPL-1.0-or-later
2- # SPDX-FileCopyrightText: 2024-2025 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
2+ # SPDX-FileCopyrightText: 2024-2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
33#
4- # ECHIDNA Container Build Redirect
4+ # ECHIDNA Minimal Container Image
55#
6- # The canonical Containerfiles are in .containerization/:
7- # .containerization/Containerfile - Minimal (Z3, CVC5, Lean, Idris2)
8- # .containerization/Containerfile.full - All Tier 1-4 provers + Julia
6+ # Includes: echidna binary + Z3 + Lean 4
7+ # For all provers + Julia ML: use .containerization/Containerfile.full
98#
10- # Build with:
11- # podman build -f .containerization/Containerfile -t echidna:latest .
12- # podman build -f .containerization/Containerfile.full -t echidna:full .
13- #
14- # Seal: selur seal echidna:latest
15- # Sign: cerro-torre sign echidna:latest
16- #
17- # Or use:
18- # just container-build
19- # just container-build-full
20- #
21- # This file exists for compatibility with tools that expect a root Containerfile.
22- # It builds the minimal image using chainguard base images.
9+ # Build: podman build -f Containerfile -t echidna:latest .
10+ # Run: podman run --rm echidna:latest --version
11+ # Or: just container-build
2312
2413# =============================================================================
2514# Stage 1: Rust Builder
@@ -41,36 +30,36 @@ COPY src/interfaces ./src/interfaces
4130RUN cargo build --release --bin echidna
4231
4332# =============================================================================
44- # Stage 2: Idris2 Builder (optional — no prebuilt binaries available)
45- # =============================================================================
46- FROM cgr.dev/chainguard/wolfi-base:latest AS idris2-builder
47-
48- # Create placeholder directories so COPY --from doesn't fail
49- RUN mkdir -p /opt/idris2/bin /build/idris/build/exec && \
50- touch /opt/idris2/bin/.keep /build/idris/build/exec/.keep
51-
52- # NOTE: Idris2 has no prebuilt Linux binaries. For full Idris2 support,
53- # use .containerization/Containerfile.full which builds from source.
54- # The minimal image ships without Idris2 — the echidna binary still works
55- # for all 30 provers; only the ABI validator requires Idris2.
56-
57- # =============================================================================
58- # Stage 3: Prover Installer
33+ # Stage 2: Prover Installer (Z3 from official release, Lean via elan)
5934# =============================================================================
6035FROM cgr.dev/chainguard/wolfi-base:latest AS prover-installer
6136
6237RUN apk add --no-cache \
63- z3 \
6438 curl \
65- ca-certificates
66-
39+ ca-certificates \
40+ gzip \
41+ unzip \
42+ bash
43+
44+ WORKDIR /tmp
45+
46+ # Install Z3 from official GitHub release
47+ RUN curl -fsSL "https://github.com/Z3Prover/z3/releases/download/z3-4.13.4/z3-4.13.4-x64-glibc-2.35.zip" \
48+ -o z3.zip && \
49+ unzip -q z3.zip && \
50+ mkdir -p /opt/z3/bin && \
51+ cp z3-4.13.4-x64-glibc-2.35/bin/z3 /opt/z3/bin/ && \
52+ chmod +x /opt/z3/bin/z3 && \
53+ rm -rf z3.zip z3-4.13.4-x64-glibc-2.35
54+
55+ # Install Lean 4 via elan
6756RUN curl -fsSL https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh | \
68- sh -s -- -y --default-toolchain stable && \
57+ bash -s -- -y --default-toolchain stable && \
6958 . "$HOME/.elan/env" && \
7059 lean --version
7160
7261# =============================================================================
73- # Stage 4 : Runtime Image (chainguard)
62+ # Stage 3 : Runtime Image (chainguard)
7463# =============================================================================
7564FROM cgr.dev/chainguard/wolfi-base:latest
7665
@@ -85,17 +74,15 @@ RUN apk add --no-cache \
8574 ca-certificates \
8675 libssl3 \
8776 gmp \
88- z3
77+ libstdc++
8978
9079WORKDIR /app
9180
9281COPY --from=rust-builder /build/target/release/echidna /app/bin/echidna
93- COPY --from=idris2-builder /opt/idris2 /opt/idris2
94- COPY --from=idris2-builder /build/idris/build/exec/echidna-validator /app/bin/echidna-validator
82+ COPY --from=prover-installer /opt/z3/bin/z3 /app/bin/z3
9583COPY --from=prover-installer /root/.elan /opt/elan
9684
97- ENV PATH="/app/bin:/opt/idris2/bin:/opt/elan/toolchains/stable/bin:${PATH}"
98- ENV IDRIS2_PREFIX="/opt/idris2"
85+ ENV PATH="/app/bin:/opt/elan/toolchains/stable/bin:${PATH}"
9986ENV ECHIDNA_PROVER_PATH="/opt"
10087
10188RUN mkdir -p /app/proofs /app/config /app/logs
0 commit comments