forked from freudenreichan/EinfuehrungInDocker_Pipeline2
Revert back Dockerfile
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
10eba3b2b5
commit
a265392fdb
30
Dockerfile
30
Dockerfile
@ -2,7 +2,7 @@
|
||||
FROM alpine:latest AS build
|
||||
|
||||
# Pakete installieren
|
||||
RUN apk add --no-cache build-base
|
||||
RUN apk add --no-cache build-base gcc curl vim net-tools
|
||||
|
||||
# Arbeitsverzeichnis setzen
|
||||
WORKDIR /app
|
||||
@ -13,30 +13,10 @@ COPY . .
|
||||
# Code kompilieren
|
||||
RUN gcc -o deployment deployment.c
|
||||
|
||||
|
||||
# ---------- Runtime Stage ----------
|
||||
FROM alpine:latest
|
||||
|
||||
# Arbeitsverzeichnis setzen
|
||||
WORKDIR /app
|
||||
|
||||
# Benutzer ohne root-Rechte anlegen
|
||||
RUN adduser -D appuser
|
||||
|
||||
# kompiliertes Programm kopieren
|
||||
COPY --from=build /app/deployment .
|
||||
|
||||
# Verzeichnis für Ausgabe anlegen
|
||||
RUN mkdir /output && chown appuser /output
|
||||
RUN mkdir /output
|
||||
|
||||
# Datavolume definieren
|
||||
VOLUME ["/output"]
|
||||
# Ausgabe wird ins Container-Dateisystem geschrieben
|
||||
ENTRYPOINT ["/bin/sh", "-c"]
|
||||
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
||||
|
||||
# Benutzer wechseln
|
||||
USER appuser
|
||||
|
||||
# HEALTHCHECK
|
||||
HEALTHCHECK CMD test -f /app/deployment || exit 1
|
||||
|
||||
# Ausgabe wird ins Datavolume geschrieben
|
||||
CMD ["sh", "-c", "./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user