forked from freudenreichan/EinfuehrungInDocker_Pipeline2
Compare commits
No commits in common. "main" and "main" have entirely different histories.
19
Dockerfile
19
Dockerfile
@ -1,8 +1,9 @@
|
||||
# Base-Image
|
||||
FROM alpine:latest
|
||||
FROM ubuntu:latest
|
||||
|
||||
# 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
|
||||
WORKDIR /app
|
||||
@ -14,16 +15,8 @@ COPY . .
|
||||
RUN gcc -o deployment deployment.c
|
||||
|
||||
# Verzeichnis für Ausgabe anlegen
|
||||
RUN mkdir /output && adduser -D -H app && chown -R app:app /output /app
|
||||
#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
|
||||
RUN mkdir /output
|
||||
|
||||
# Ausgabe wird ins Container-Dateisystem geschrieben
|
||||
ENTRYPOINT ["/bin/sh", "-c"]
|
||||
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
||||
ENTRYPOINT ["/bin/bash", "-c"]
|
||||
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
||||
Loading…
x
Reference in New Issue
Block a user