Compare commits

..

1 Commits
main ... main

Author SHA1 Message Date
1a0fcbbd12 .drone.yml aktualisiert 2026-04-11 11:45:33 +00:00
2 changed files with 18 additions and 25 deletions

View File

@ -26,7 +26,7 @@ steps:
fi fi
- name: security-scan - name: security-scan
image: aquasec/trivy:latest image: ghcr.io/aquasecurity/trivy:0.69.3
commands: commands:
- trivy image --input image.tar --severity HIGH,CRITICAL --exit-code 1 - trivy image --input image.tar --severity HIGH,CRITICAL --exit-code 1
@ -47,7 +47,7 @@ steps:
# Repo clonen # Repo clonen
- git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git - git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git
- cd EinfuehrungInDocker_Pipeline2 - cd EinfuehrungInDocker_Pipeline
# Branch wechseln oder erstellen # Branch wechseln oder erstellen
- git checkout drone-artifacts || git checkout -b drone-artifacts - git checkout drone-artifacts || git checkout -b drone-artifacts
@ -64,4 +64,4 @@ steps:
- git pull || true - git pull || true
# Push # Push
- git push - git push

View File

@ -1,29 +1,22 @@
FROM alpine:3.20 AS builder # Base-Image
FROM ubuntu:latest
RUN apk add --no-cache build-base # Pakete installieren
RUN apt-get update
WORKDIR /app RUN apt-get install -y build-essential gcc curl vim net-tools
COPY deployment.c .
RUN gcc -O2 -o deployment deployment.c
FROM alpine:3.20
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
# Arbeitsverzeichnis setzen
WORKDIR /app WORKDIR /app
COPY --from=builder /app/deployment /app/deployment # alles kopieren
COPY . .
RUN mkdir -p /output && chown -R appuser:appgroup /app /output # Code kompilieren
RUN gcc -o deployment deployment.c
USER appuser # Verzeichnis für Ausgabe anlegen
RUN mkdir /output
VOLUME ["/output"] # Ausgabe wird ins Container-Dateisystem geschrieben
ENTRYPOINT ["/bin/bash", "-c"]
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
CMD test -f /output/output.txt || exit 1
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["./deployment 10 >> /output/output.txt && tail -f /output/output.txt"]