2026-04-25 11:16:35 +00:00

32 lines
611 B
Docker

# Base-Image
FROM alpine AS build_stage
# Pakete installieren
RUN apk update
RUN apk add --no-cache build-base gcc curl vim net-tools
RUN apk add --no-cache bash
# Arbeitsverzeichnis setzen
WORKDIR /app
# alles kopieren
COPY . .
# Code kompilieren
RUN gcc -o deployment deployment.c
FROM alpine AS runtime
RUN apk add --no-cache bash
WORKDIR /app
COPY --from=build_stage /app/deployment .
# Verzeichnis für Ausgabe anlegen
RUN mkdir /output
# Ausgabe wird ins Container-Dateisystem geschrieben
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]