From 12c488ead85945bc08872ac357b92389a99e5494 Mon Sep 17 00:00:00 2001 From: Tobias Niegratschka Date: Sat, 25 Apr 2026 06:26:57 +0000 Subject: [PATCH] Dockerfile aktualisiert --- Dockerfile | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index f39abbc..c097c13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,26 @@ -# BUILDER STAGE -FROM alpine:3.20 AS builder -RUN apk add --no-cache build-base +# Base-Image +FROM alpine:latest + +# Pakete installieren (build-base entspricht build-essential/gcc) +RUN apk update && apk add --no-cache \ + build-base \ + curl \ + vim \ + net-tools \ + bash + +# Arbeitsverzeichnis setzen WORKDIR /app -COPY deployment.c . + +# alles kopieren +COPY . . + +# Code kompilieren RUN gcc -o deployment deployment.c -# RUNTIME STAGE -FROM alpine:3.20 -WORKDIR /app -COPY --from=builder /app/deployment . +# Verzeichnis für Ausgabe anlegen RUN mkdir /output -ENTRYPOINT ["/bin/sh", "-c"] +# Ausgabe wird ins Container-Dateisystem geschrieben +ENTRYPOINT ["/bin/bash", "-c"] CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"] \ No newline at end of file