forked from freudenreichan/EinfuehrungInDocker_Pipeline2
Dockerfile aktualisiert
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
73e3ebdc4e
commit
cf2f548c79
12
Dockerfile
12
Dockerfile
@ -1,9 +1,11 @@
|
||||
# Base-Image
|
||||
FROM alpine:3.21
|
||||
FROM alpine:latest
|
||||
|
||||
# Pakete installieren
|
||||
RUN apk add --no-cache build-base gcc
|
||||
|
||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||
|
||||
# Arbeitsverzeichnis setzen
|
||||
WORKDIR /app
|
||||
|
||||
@ -16,6 +18,14 @@ RUN gcc -o deployment deployment.c
|
||||
# Verzeichnis für Ausgabe anlegen
|
||||
RUN mkdir /output
|
||||
|
||||
VOLUME ["/output"]
|
||||
|
||||
USER appuser
|
||||
|
||||
#Healthcheck
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
||||
CMD test -f /output/output.txt || exit 1
|
||||
|
||||
# Ausgabe wird ins Container-Dateisystem geschrieben
|
||||
ENTRYPOINT ["/bin/sh", "-c"]
|
||||
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
||||
Loading…
x
Reference in New Issue
Block a user