forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.vmcompat
More file actions
38 lines (32 loc) · 1.32 KB
/
Dockerfile.vmcompat
File metadata and controls
38 lines (32 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
ARG GO_VERSION=1.24.10-alpine3.21
ARG VM_TARGET=current
FROM golang:${GO_VERSION} AS builder
# Redeclare ARG to make it available in this build stage
ARG VM_TARGET
# Install dependencies
RUN apk add --no-cache make git bash jq llvm
# Build vm-compat binary
RUN mkdir -p /tmp/vm-compat && \
cd /tmp/vm-compat && \
git clone https://github.com/ethereum-optimism/vm-compat.git . && \
git fetch --tags && \
git checkout -q v1.1.0 && \
make && \
cp bin/analyzer /usr/local/bin/vm-compat && \
cd / && \
rm -rf /tmp/vm-compat
# Copy local files, download go dependencies
WORKDIR /app
COPY ./go.mod ./go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build go mod download
COPY . /app
# Run the op-program analysis, capturing findings even on failure.
# The exit code is saved so the caller can extract findings before failing.
WORKDIR /app/op-program
ENV FINDINGS_OUTPUT_PATH=/app/op-program/vm-compat-findings.json
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \
touch $FINDINGS_OUTPUT_PATH && \
make "analyze-op-program-client-${VM_TARGET}"; echo $? > /app/op-program/vm-compat-exit-code
FROM scratch AS export
COPY --from=builder /app/op-program/vm-compat-findings.json .
COPY --from=builder /app/op-program/vm-compat-exit-code .