Remove unnecessary steps in dockcer image, use alpine:latest for the 2nd stage

This commit is contained in:
SeanOMik 2024-01-22 17:02:03 -05:00
parent 61d14e25a4
commit 6dcfed33c7
Signed by: SeanOMik
GPG Key ID: FEC9E2FC15235964
1 changed files with 5 additions and 5 deletions

View File

@ -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