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

View File

@ -26,7 +26,7 @@ steps:
fi fi
- name: security-scan - name: security-scan
image: aquasec/trivy:0.58.2 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
@ -46,8 +46,8 @@ steps:
#- git remote set-url origin https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2 #- git remote set-url origin https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2
# Repo clonen # Repo clonen
- git clone https://git.efi.th-nuernberg.de/gitea/kuerzdoerferta96614/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

View File

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