Compare commits

..

No commits in common. "main" and "main" have entirely different histories.
main ... main

View File

@ -1,10 +1,9 @@
# Base-Image # Base-Image
FROM alpine AS build_stage FROM ubuntu:latest
# Pakete installieren # Pakete installieren
RUN apk update RUN apt-get update
RUN apk add --no-cache build-base gcc curl vim net-tools RUN apt-get install -y build-essential gcc curl vim net-tools
RUN apk add --no-cache bash
# Arbeitsverzeichnis setzen # Arbeitsverzeichnis setzen
WORKDIR /app WORKDIR /app
@ -15,28 +14,9 @@ COPY . .
# Code kompilieren # Code kompilieren
RUN gcc -o deployment deployment.c RUN gcc -o deployment deployment.c
FROM alpine AS runtime
RUN apk add --no-cache bash
#RUN adduser -u 1000 -g 1000 -D -s /bin/bash fabian
WORKDIR /app
COPY --from=build_stage /app/deployment .
# Verzeichnis für Ausgabe anlegen # Verzeichnis für Ausgabe anlegen
#USER root RUN mkdir /output
RUN mkdir /output && chown 1000:1000 /output
#USER fabian
USER 1000:1000
VOLUME ["/output"]
#Healthcheck
HEALTHCHECK --interval=30s CMD test -f /output/output.txt || exit 1
# Ausgabe wird ins Container-Dateisystem geschrieben # Ausgabe wird ins Container-Dateisystem geschrieben
ENTRYPOINT ["/bin/bash", "-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"]