Fix AVM analyzer docker build. Fixes #1508
diff --git a/tools/avm_analyzer/Dockerfile.builder b/tools/avm_analyzer/Dockerfile.builder index 06e0e0a..7eed870 100644 --- a/tools/avm_analyzer/Dockerfile.builder +++ b/tools/avm_analyzer/Dockerfile.builder
@@ -1,24 +1,23 @@ # TODO(comc): cargo chef caching doesn't seem to be working properly. FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef -RUN apt-get update -RUN apt-get install -y make pkg-config git unzip cmake protobuf-compiler libssl-dev --no-install-recommends -RUN cargo install trunk +RUN apt-get update && apt-get install -y make pkg-config git unzip cmake protobuf-compiler libssl-dev --no-install-recommends +RUN cargo install trunk --locked --version ^0.20 RUN rustup target add wasm32-unknown-unknown RUN mkdir /extract_proto COPY tools/extract_proto/avm_frame.proto /extract_proto/avm_frame.proto WORKDIR /app -FROM chef as planner_frontend +FROM chef AS planner_frontend COPY tools/avm_analyzer . -RUN cargo chef prepare --recipe-path recipe.json --bin avm_analyzer_app +RUN cargo chef prepare --recipe-path recipe.json FROM chef AS cacher_frontend COPY --from=planner_frontend /app/recipe.json recipe.json RUN cargo chef cook --release --target wasm32-unknown-unknown --recipe-path recipe.json --bin avm-analyzer-app -FROM chef as planner_backend +FROM chef AS planner_backend COPY tools/avm_analyzer /app -RUN cargo chef prepare --recipe-path recipe.json --bin avm_analyzer_server +RUN cargo chef prepare --recipe-path recipe.json FROM chef AS cacher_backend COPY --from=planner_backend /app/recipe.json recipe.json @@ -27,20 +26,20 @@ FROM chef AS builder_frontend COPY --from=cacher_frontend /app . COPY tools/avm_analyzer . -RUN trunk build --config avm_analyzer_app --release +RUN cd avm_analyzer_app && trunk build --release FROM chef AS builder_backend COPY --from=cacher_backend /app . COPY tools/avm_analyzer . RUN cargo build --release --bin avm-analyzer-server -FROM avm_analyzer_runtime as avm_builder +FROM avm_analyzer_runtime AS avm_builder COPY . /avm RUN mkdir /avm_build RUN /scripts/build_avm.sh --avm_build_dir /avm_build --avm_source_dir /avm RUN rm -r /avm -FROM avm_analyzer_runtime as runtime +FROM avm_analyzer_runtime AS runtime WORKDIR /app COPY --from=builder_frontend /app/avm_analyzer_app/dist dist COPY --from=builder_backend /app/target/release/avm-analyzer-server avm-analyzer-server
diff --git a/tools/avm_analyzer/Dockerfile.runtime b/tools/avm_analyzer/Dockerfile.runtime index af2011e..b805425 100644 --- a/tools/avm_analyzer/Dockerfile.runtime +++ b/tools/avm_analyzer/Dockerfile.runtime
@@ -1,7 +1,6 @@ # Basic runtime image with required dependencies to build libavm. -FROM ubuntu:22.04 -RUN apt-get update -RUN apt-get install -y cmake git perl g++ yasm make protobuf-compiler libprotobuf-dev python3 --no-install-recommends +FROM ubuntu:24.04 +RUN apt-get update && apt-get install -y cmake git perl g++ yasm make protobuf-compiler libprotobuf-dev python3 --no-install-recommends WORKDIR /scripts COPY tools/avm_analyzer/build_avm.sh /scripts/build_avm.sh RUN chmod +x /scripts/build_avm.sh