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