diff --git a/docker-bake.hcl b/docker-bake.hcl index 57f5dbbfff6e..f0b57e565190 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -6,6 +6,10 @@ variable "REPOSITORY" { default = "oplabs-tools-artifacts/images" } +variable "KONA_VERSION" { + default = "kona-client-v0.1.0-beta.4" +} + variable "GIT_COMMIT" { default = "dev" } @@ -119,6 +123,7 @@ target "op-challenger" { GIT_COMMIT = "${GIT_COMMIT}" GIT_DATE = "${GIT_DATE}" OP_CHALLENGER_VERSION = "${OP_CHALLENGER_VERSION}" + KONA_VERSION="${KONA_VERSION}" } target = "op-challenger-target" platforms = split(",", PLATFORMS) @@ -207,7 +212,7 @@ target "proofs-tools" { context = "." args = { CHALLENGER_VERSION="b46bffed42db3442d7484f089278d59f51503049" - KONA_VERSION="kona-client-v0.1.0-beta.4" + KONA_VERSION="${KONA_VERSION}" } target="proofs-tools" platforms = split(",", PLATFORMS) diff --git a/ops/docker/op-stack-go/Dockerfile b/ops/docker/op-stack-go/Dockerfile index ef1da6ce116c..9384aef5e247 100644 --- a/ops/docker/op-stack-go/Dockerfile +++ b/ops/docker/op-stack-go/Dockerfile @@ -9,6 +9,13 @@ # It will default to the target platform. ARG TARGET_BASE_IMAGE=alpine:3.20 +# The ubuntu target base image is used for the op-challenger build with kona and asterisc. +ARG UBUNTU_TARGET_BASE_IMAGE=ubuntu:22.04 + +# The version of kona to use. +# The only build that uses this is `op-challenger-target`. +ARG KONA_VERSION=none + # We may be cross-building for another platform. Specify which platform we need as builder. FROM --platform=$BUILDPLATFORM golang:1.22.7-alpine3.20 AS builder @@ -136,14 +143,23 @@ FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-node-target COPY --from=op-node-builder /app/op-node/bin/op-node /usr/local/bin/ CMD ["op-node"] -FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-challenger-target +# Make the kona docker image published by upstream available as a source to copy kona and asterisc from. +FROM --platform=$BUILDPLATFORM ghcr.io/anton-rs/kona/kona-fpp-asterisc:$KONA_VERSION AS kona + +# Also produce an op-challenger loaded with kona and asterisc using ubuntu +FROM --platform=$TARGETPLATFORM $UBUNTU_TARGET_BASE_IMAGE AS op-challenger-target +RUN apt-get update && apt-get install -y --no-install-recommends musl openssl ca-certificates COPY --from=op-challenger-builder /app/op-challenger/bin/op-challenger /usr/local/bin/ -# Make the bundled op-program the default cannon server +# Copy in op-program and cannon COPY --from=op-program-builder /app/op-program/bin/op-program /usr/local/bin/ ENV OP_CHALLENGER_CANNON_SERVER /usr/local/bin/op-program -# Make the bundled cannon the default cannon executable COPY --from=cannon-builder /app/cannon/bin/cannon /usr/local/bin/ ENV OP_CHALLENGER_CANNON_BIN /usr/local/bin/cannon +# Copy in kona and asterisc +COPY --from=kona /kona-host /usr/local/bin/ +ENV OP_CHALLENGER_ASTERISC_KONA_SERVER=/usr/local/bin/kona-host +COPY --from=kona /asterisc /usr/local/bin/ +ENV OP_CHALLENGER_ASTERISC_BIN=/usr/local/bin/asterisc CMD ["op-challenger"] FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-dispute-mon-target