Image größe optimiert
continuous-integration/drone/push Build is failing

This commit is contained in:
2026-04-22 11:12:37 +02:00
parent 8c03a54db6
commit 65af3e65c9
4 changed files with 104 additions and 19 deletions
+3 -19
View File
@@ -1,7 +1,8 @@
# Base-Image
FROM alpine:latest AS builder
FROM alpine:latest
# Pakete installieren
RUN apk upgrade --no-cache
RUN apk add --no-cache build-base
# Arbeitsverzeichnis setzen
@@ -13,25 +14,8 @@ COPY . .
# Code kompilieren
RUN gcc -o deployment deployment.c
# Stage 2
FROM alpine:latest
RUN apk upgrade --no-cache
RUN addgroup -S stdgroup && adduser -S stduser -G stdgroup
WORKDIR /app
COPY --from=builder /app/deployment .
# Verzeichnis für Ausgabe anlegen
RUN mkdir /output && chown stduser:stdgroup /output
VOLUME ["/output"]
USER stduser
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 CMD test -f /output/output.txt || exit 1
RUN mkdir /output
# Ausgabe wird ins Container-Dateisystem geschrieben
ENTRYPOINT ["/bin/bash", "-c"]