From b562626a454103ec1ced44dc686251fd994b7a61 Mon Sep 17 00:00:00 2001 From: Anatoly Date: Sat, 5 Oct 2024 17:40:57 +0300 Subject: [PATCH] Optimize Dockerfile size Split Dockerfile into two stages to reduce end size --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 385e32c..55ba896 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,13 @@ WORKDIR /jito-programs COPY . . RUN mkdir -p ./container-out -# Uses docker buildkite to cache the image. RUN solana --version RUN --mount=type=cache,mode=0777,target=/jito-programs/target \ --mount=type=cache,mode=0777,target=/usr/local/cargo/registry \ - cd ./mev-programs && anchor build && cp target/deploy/* ../container-out; \ No newline at end of file + cd ./mev-programs && anchor build && cp target/deploy/* ../container-out; + +FROM debian:bullseye-slim + +COPY --from=builder /jito-programs/container-out /jito-programs/container-out + +WORKDIR /jito-programs