MultiStageBuild

This commit is contained in:
Fabian Guth 2026-04-25 11:16:35 +00:00
parent f2b91dba26
commit 14535e58b6

View File

@ -1,5 +1,5 @@
# Base-Image
FROM alpine
FROM alpine AS build_stage
# Pakete installieren
RUN apk update
@ -15,6 +15,14 @@ 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