forked from freudenreichan/EinfuehrungInDocker_Pipeline2
Compare commits
No commits in common. "main" and "main" have entirely different histories.
17
Dockerfile
17
Dockerfile
@ -1,8 +1,9 @@
|
|||||||
# Base-Image
|
# Base-Image
|
||||||
FROM alpine:latest
|
FROM ubuntu:latest
|
||||||
|
|
||||||
# Pakete installieren
|
# Pakete installieren
|
||||||
RUN apk add --no-cache build-base curl vim net-tools
|
RUN apt-get update
|
||||||
|
RUN apt-get install -y build-essential gcc curl vim net-tools
|
||||||
|
|
||||||
# Arbeitsverzeichnis setzen
|
# Arbeitsverzeichnis setzen
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@ -14,16 +15,8 @@ COPY . .
|
|||||||
RUN gcc -o deployment deployment.c
|
RUN gcc -o deployment deployment.c
|
||||||
|
|
||||||
# Verzeichnis für Ausgabe anlegen
|
# Verzeichnis für Ausgabe anlegen
|
||||||
RUN mkdir /output && adduser -D -H app && chown -R app:app /output /app
|
RUN mkdir /output
|
||||||
#verzeichnis intern anlegen
|
|
||||||
VOLUME ["/output"]
|
|
||||||
# User wechseln damit kein root mehr
|
|
||||||
USER app
|
|
||||||
|
|
||||||
#Health-Check
|
|
||||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
|
||||||
CMD [ "$(find /output/output.txt -mmin -1 2>/dev/null)" ] || exit 1
|
|
||||||
|
|
||||||
# Ausgabe wird ins Container-Dateisystem geschrieben
|
# Ausgabe wird ins Container-Dateisystem geschrieben
|
||||||
ENTRYPOINT ["/bin/sh", "-c"]
|
ENTRYPOINT ["/bin/bash", "-c"]
|
||||||
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
||||||
Loading…
x
Reference in New Issue
Block a user