forked from freudenreichan/EinfuehrungInDocker_Pipeline2
Dockerfile aktualisiert
This commit is contained in:
parent
bcd8ec8c3e
commit
f3769cb32c
27
Dockerfile
27
Dockerfile
@ -1,22 +1,17 @@
|
||||
# Base-Image
|
||||
FROM ubuntu:latest
|
||||
|
||||
# Pakete installieren
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y build-essential gcc curl vim net-tools
|
||||
|
||||
# Arbeitsverzeichnis setzen
|
||||
# BUILDER STAGE
|
||||
FROM alpine:3.20 AS builder
|
||||
RUN apk add --no-cache build-base
|
||||
WORKDIR /app
|
||||
|
||||
# alles kopieren
|
||||
COPY . .
|
||||
|
||||
# Code kompilieren
|
||||
COPY deployment.c .
|
||||
# Wir bauen hier noch "normal"
|
||||
RUN gcc -o deployment deployment.c
|
||||
|
||||
# Verzeichnis für Ausgabe anlegen
|
||||
# RUNTIME STAGE
|
||||
FROM alpine:3.20
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/deployment .
|
||||
RUN mkdir /output
|
||||
|
||||
# Ausgabe wird ins Container-Dateisystem geschrieben
|
||||
ENTRYPOINT ["/bin/bash", "-c"]
|
||||
# Wir nutzen sh (Standard in Alpine), da bash extra installiert werden müsste
|
||||
ENTRYPOINT ["/bin/sh", "-c"]
|
||||
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
||||
Loading…
x
Reference in New Issue
Block a user