From acc70d3d804ce797523856d482a2eaad19a9717b Mon Sep 17 00:00:00 2001 From: naskya Date: Sun, 7 Jan 2024 17:55:09 +0900 Subject: [PATCH] docker: simplify Rust installation & remove (seemingly) unused build dependencies --- Dockerfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index b3c0a6e31..4b6b3207a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,12 +3,9 @@ FROM docker.io/node:21-slim as build WORKDIR /firefish # Install compilation dependencies -RUN apt-get update && DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends python3 git wget curl build-essential ca-certificates -RUN mkdir -m777 /opt/rust /opt/cargo -ENV RUSTUP_HOME=/opt/rust CARGO_HOME=/opt/cargo PATH=/opt/cargo/bin:$PATH -RUN wget --https-only --secure-protocol=TLSv1_2 -O- https://sh.rustup.rs | sh /dev/stdin -y -RUN printf '#!/bin/sh\nexport CARGO_HOME=/opt/cargo\nexec /bin/sh "$@"\n' >/usr/local/bin/sh -RUN chmod +x /usr/local/bin/sh +RUN apt-get update && DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends curl build-essential ca-certificates +RUN curl --proto '=https' --tlsv1.2 --silent --show-error --fail https://sh.rustup.rs | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" # Copy only the cargo dependency-related files first, to cache efficiently COPY packages/backend/native-utils/Cargo.toml packages/backend/native-utils/Cargo.toml