From dd9bec78662b44adebf6fb83dcfb52f3e1e0deec Mon Sep 17 00:00:00 2001 From: Michalis Kargakis Date: Wed, 7 Jun 2023 23:40:53 +0200 Subject: [PATCH] Fix docker build (#22) --- Dockerfile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7cb27ad..bcf6d40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ FROM chef AS planner COPY . . RUN cargo chef prepare --recipe-path recipe.json -## Builder stage: Build binary for strategy +## Builder stage: Build binary FROM chef AS builder COPY --from=planner /app/recipe.json recipe.json # Install system dependencies @@ -14,17 +14,12 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg- RUN cargo chef cook --release --recipe-path recipe.json # Build application COPY . . -# Pass in the strategy you want to run as a build arg -ARG strategy=opensea_sudo_arb -RUN cargo build --release --bin $strategy +RUN cargo build --release ## Runtime stage: Copy binary to new image and run FROM ubuntu:20.04 AS runtime WORKDIR app -ARG strategy=opensea_sudo_arb -# Make build arg available at runtime for entrypoint -ENV strategy $strategy -COPY --from=builder /app/target/release/$strategy /usr/local/bin +COPY --from=builder /app/target/release/artemis /usr/local/bin # Install openssl and ca-certificates RUN apt-get update && apt install -y openssl && apt install -y ca-certificates -ENTRYPOINT /usr/local/bin/$strategy \ No newline at end of file +ENTRYPOINT /usr/local/bin/artemis