From 16b77e69fad8523e62583a926824bcda8a94db98 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 31 Oct 2023 14:36:06 +0100 Subject: [PATCH] Improve Docker layer caching --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4ebf30e..e50dce8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,13 @@ FROM rust:1.71-slim as base WORKDIR /analyzer -COPY . . - RUN apt-get update && \ apt-get install -y musl musl-dev musl-tools && \ - rustup target add x86_64-unknown-linux-musl && \ - cargo build --release --target=x86_64-unknown-linux-musl && \ + rustup target add x86_64-unknown-linux-musl + +COPY . . + +RUN cargo build --release --target=x86_64-unknown-linux-musl && \ cp target/x86_64-unknown-linux-musl/release/rust-analyzer ./bin/ FROM alpine:latest