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 19 additions and 31 deletions

View File

@ -26,7 +26,7 @@ steps:
fi
- name: security-scan
image: aquasec/trivy:latest
image: ghcr.io/aquasecurity/trivy:0.69.3
commands:
- trivy image --input image.tar --severity HIGH,CRITICAL --exit-code 1
@ -47,13 +47,13 @@ steps:
# Repo clonen
- git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git
- cd EinfuehrungInDocker_Pipeline2
- cd EinfuehrungInDocker_Pipeline
# Branch wechseln oder erstellen
- git checkout drone-artifacts || git checkout -b drone-artifacts
# Artifact löschen und neu hinzufügen
- rm -f image.tar
- git rm image.tar
- cp $DRONE_WORKSPACE/image.tar .
- git add image.tar
@ -64,4 +64,4 @@ steps:
- git pull || true
# Push
- git push --set-upstream origin drone-artifacts
- git push

View File

@ -1,34 +1,22 @@
FROM alpine:3.20
# Base-Image
FROM ubuntu:latest
# gcc installieren
RUN apk add --no-cache gcc musl-dev
# Pakete installieren
RUN apt-get update
RUN apt-get install -y build-essential gcc curl vim net-tools
# Arbeitsverzeichnis
# Arbeitsverzeichnis setzen
WORKDIR /app
# Dateien kopieren
COPY deployment.c .
# alles kopieren
COPY . .
# Programm kompilieren
RUN gcc -O2 -o deployment deployment.c
# Code kompilieren
RUN gcc -o deployment deployment.c
# Non-root User
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
# Verzeichnis für Ausgabe anlegen
RUN mkdir /output
# Output-Verzeichnis
RUN mkdir /output && chown -R appuser:appgroup /output /app
# Datavolume
VOLUME ["/output"]
# User wechseln
USER appuser
# Healthcheck
HEALTHCHECK CMD test -f /output/output.txt || exit 1
# Anwendung starten
CMD ["/bin/sh", "-c", "./deployment 10 > /output/output.txt"]
# Start
CMD ["/app/deployment", "10"]
# Ausgabe wird ins Container-Dateisystem geschrieben
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]