Skip to content

Commit

Permalink
Fix docker build (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmichalis authored Jun 7, 2023
1 parent 88b664b commit dd9bec7
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
ENTRYPOINT /usr/local/bin/artemis

0 comments on commit dd9bec7

Please sign in to comment.