From 6dcfed33c70b230f6441c81b055006e3399ac4be Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Mon, 22 Jan 2024 17:02:03 -0500 Subject: [PATCH] Remove unnecessary steps in dockcer image, use alpine:latest for the 2nd stage --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2425be8..b5ca970 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,8 @@ RUN apk update RUN apk add build-base ca-certificates libressl-dev # Install rust toolchains -RUN rustup toolchain install stable -RUN rustup default stable +#RUN rustup toolchain install stable +#RUN rustup default stable # create root application folder WORKDIR /app @@ -14,15 +14,15 @@ COPY ./ /app/src WORKDIR /app/src # Build dependencies only. Separate these for caches -RUN cargo install cargo-build-deps -RUN sh -c "cargo build-deps --release" +#RUN cargo install cargo-build-deps +#RUN sh -c "cargo build-deps --release" # Build the release executable. RUN sh -c "cargo build --release" # Runner stage. I tried using distroless (gcr.io/distroless/static-debian11), but the image was only ~3MBs smaller than # alpine. I chose to use alpine since it makes it easier to exec into the container to debug things. -FROM rust:1.75-alpine +FROM alpine:latest ARG UNAME=exporter ARG UID=1000