Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
erebe committed Oct 21, 2023
1 parent dc7215f commit 1041b4a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
ARG BUILDER_IMAGE=builder_cache
ARG ALPINE_IMAGE_TAG=3.18

############################################################
# Cache image with all the deps
FROM rust:1.73-alpine${ALPINE_IMAGE_TAG} AS builder_cache
FROM rust:1.73-bookworm AS builder_cache

RUN apk add musl-dev
RUN rustup component add rustfmt clippy

WORKDIR /build
Expand Down Expand Up @@ -39,10 +37,14 @@ RUN cargo build --profile=${PROFILE} ${BIN_TARGET}

############################################################
# Final image
FROM alpine:${ALPINE_IMAGE_TAG} as final-image

RUN apk add dumb-init && \
adduser -Ds /bin/sh app
FROM debian:bookworm-slim as final-image

RUN useradd -ms /bin/bash app && \
apt-get update && \
apt-get -y upgrade && \
apt install -y --no-install-recommends ca-certificates dumb-init && \
apt-get clean && \
rm -rf /var/lib/apt/lists

WORKDIR /home/app

Expand Down

0 comments on commit 1041b4a

Please sign in to comment.