Compare commits

...

9 Commits
main ... main

Author SHA1 Message Date
aad5f91d49 Update Dockerfile 2026-04-17 20:32:09 +00:00
12883602f8 Update Dockerfile 2026-04-17 20:21:44 +00:00
4b4bcbf56e Update Dockerfile 2026-04-11 12:01:12 +00:00
3df50360e6 Update Dockerfile 2026-04-11 11:55:45 +00:00
e7304fab26 Update Dockerfile 2026-04-11 11:55:05 +00:00
34728990c3 Update Dockerfile 2026-04-11 11:51:08 +00:00
5b71c9a2b7 Update .drone.yml 2026-04-11 11:50:08 +00:00
b9bea866a3 Update Dockerfile 2026-04-11 11:45:31 +00:00
ff4d035d4f Update Dockerfile 2026-04-11 11:43:27 +00:00
2 changed files with 29 additions and 16 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

View File

@ -1,22 +1,35 @@
# Base-Image
FROM ubuntu:latest
#schlankes Base-Images
FROM alpine:3.19 AS builder
# Pakete installieren
RUN apt-get update
RUN apt-get install -y build-essential gcc curl vim net-tools
# Nur das nötigste
RUN apk add --no-cache gcc musl-dev
WORKDIR /app
COPY deployment.c .
RUN gcc -o deployment deployment.c -static
# Nicht-root User anlegen
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
# Ausgabe-Verzeichnis anlegen und Rechte setzen
RUN mkdir /output && chown appuser:appgroup /output
# Arbeitsverzeichnis setzen
WORKDIR /app
# alles kopieren
COPY . .
# Nur das Binary aus dem Build-Stage kopieren
COPY --from=builder /app/deployment .
RUN chown appuser:appgroup /app/deployment
# Code kompilieren
RUN gcc -o deployment deployment.c
# Volume für die Ausgabe
VOLUME /output
# Verzeichnis für Ausgabe anlegen
RUN mkdir /output
# Als nicht-root User laufen
USER appuser
# Ausgabe wird ins Container-Dateisystem geschrieben
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
# Healthcheck: prüft ob das Binary vorhanden und ausführbar ist
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD test -x /app/deployment || exit 1
ENTRYPOINT ["/app/deployment"]
CMD ["10"]