From b06a8a79c920a2a6a4006ece1e20e24cb60fc838 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sat, 12 Nov 2022 01:11:07 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20drone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3cd1346..9febb62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,47 +1,11 @@ -#################################################################################################### -## Builder -#################################################################################################### FROM rust:latest AS builder -RUN rustup target add x86_64-unknown-linux-musl -RUN apt update && apt install -y musl-tools musl-dev -RUN update-ca-certificates - -# Create appuser -ENV USER=actix -ENV UID=10001 - -RUN adduser \ - --disabled-password \ - --gecos "" \ - --home "/nonexistent" \ - --shell "/sbin/nologin" \ - --no-create-home \ - --uid "${UID}" \ - "${USER}" - - WORKDIR /app COPY ./ . RUN cargo build --target x86_64-unknown-linux-musl --release -#################################################################################################### -## Final image -#################################################################################################### -FROM alpine - -# Import from builder. -COPY --from=builder /etc/passwd /etc/passwd -COPY --from=builder /etc/group /etc/group - -WORKDIR /app - -# Copy our build -COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/me-site ./ - -# Use an unprivileged user. -USER actix:actix +COPY /app/target/release/me-site /me-site CMD ["/me-site"]