diff --git a/Dockerfile b/Dockerfile index 53c071aa0..eef100339 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,13 @@ ENV TINI_VERSION v0.19.0 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini-static RUN sudo chmod +x /tini-static +# Copy to Cargo setting and change the owner +COPY --chown=rust:rust Cargo.toml Cargo.lock ./ +# Build empty project for better cache +RUN mkdir src && \ + echo "fn main() {}" > src/main.rs && \ + cargo build --release && rm -r src + # Copy to current directory and change the owner COPY --chown=rust:rust . ./ # Build