Update Dockerfile

Former-commit-id: 8d641440227dba9e956433206907ee8907593b82 [formerly 344e8a30b34d1d1695638a352c6601149bf5fc88] [formerly 5c24156ddfbe29981c628598a230a17fa7ead6c4 [formerly 1041b4af40fd8c6f189a13bc7ea1980fd40fb977]]
Former-commit-id: b63126e8a1bd9304e91828ab30c72ebb04f2c812 [formerly d516e15a7420610d130a572a724190ecf15678e6]
Former-commit-id: 02f1cbd58b36eb1b416b64df9d857a24866d32b4
Former-commit-id: 7777b39fe0ee8a4421578eae43a3af8b870af91e
Former-commit-id: 475f2f6f0564bf611a2a0129cbb9b8f466769983
Former-commit-id: 6f77659bc79c02139550f4366a9597b5362463c2 [formerly fb41f997d9c2fb551819eb918f268999a875bfa7]
Former-commit-id: b58e203e9b3277aa3e44cfba6017d23efabdce3c
This commit is contained in:
Σrebe - Romain GERARD 2023-10-21 17:01:32 +02:00
parent b37b00ca41
commit bdcb0ddbbd

View file

@ -1,11 +1,9 @@
ARG BUILDER_IMAGE=builder_cache ARG BUILDER_IMAGE=builder_cache
ARG ALPINE_IMAGE_TAG=3.18
############################################################ ############################################################
# Cache image with all the deps # 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 RUN rustup component add rustfmt clippy
WORKDIR /build WORKDIR /build
@ -39,10 +37,14 @@ RUN cargo build --profile=${PROFILE} ${BIN_TARGET}
############################################################ ############################################################
# Final image # Final image
FROM alpine:${ALPINE_IMAGE_TAG} as final-image FROM debian:bookworm-slim as final-image
RUN apk add dumb-init && \ RUN useradd -ms /bin/bash app && \
adduser -Ds /bin/sh 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 WORKDIR /home/app