Fabian Guth 86a45d2708
Some checks failed
continuous-integration/drone/push Build is failing
ubuntu Build stage aber alpine prod
UbuntuBased aber Multistage
2026-04-25 13:57:43 +00:00

30 lines
598 B
Docker

# Base-Image
FROM ubuntu:latest AS build_stage
# Pakete installieren
RUN apt-get update
RUN apt-get install -y build-essential gcc curl vim net-tools
# 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"]