9 Commits
Author SHA1 Message Date
arnoldem94154 aad5f91d49 Update Dockerfile 2026-04-17 20:32:09 +00:00
arnoldem94154 12883602f8 Update Dockerfile 2026-04-17 20:21:44 +00:00
arnoldem94154 4b4bcbf56e Update Dockerfile 2026-04-11 12:01:12 +00:00
arnoldem94154 3df50360e6 Update Dockerfile 2026-04-11 11:55:45 +00:00
arnoldem94154 e7304fab26 Update Dockerfile 2026-04-11 11:55:05 +00:00
arnoldem94154 34728990c3 Update Dockerfile 2026-04-11 11:51:08 +00:00
arnoldem94154 5b71c9a2b7 Update .drone.yml 2026-04-11 11:50:08 +00:00
arnoldem94154 b9bea866a3 Update Dockerfile 2026-04-11 11:45:31 +00:00
arnoldem94154 ff4d035d4f Update Dockerfile 2026-04-11 11:43:27 +00:00
2 changed files with 29 additions and 16 deletions
+1 -1
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
+28 -15
View File
@@ -1,22 +1,35 @@
# Base-Image #schlankes Base-Images
FROM ubuntu:latest FROM alpine:3.19 AS builder
# Pakete installieren # Nur das nötigste
RUN apt-get update RUN apk add --no-cache gcc musl-dev
RUN apt-get install -y build-essential gcc curl vim net-tools
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 WORKDIR /app
# alles kopieren # Nur das Binary aus dem Build-Stage kopieren
COPY . . COPY --from=builder /app/deployment .
RUN chown appuser:appgroup /app/deployment
# Code kompilieren # Volume für die Ausgabe
RUN gcc -o deployment deployment.c VOLUME /output
# Verzeichnis für Ausgabe anlegen # Als nicht-root User laufen
RUN mkdir /output USER appuser
# Ausgabe wird ins Container-Dateisystem geschrieben # Healthcheck: prüft ob das Binary vorhanden und ausführbar ist
ENTRYPOINT ["/bin/bash", "-c"] HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"] CMD test -x /app/deployment || exit 1
ENTRYPOINT ["/app/deployment"]
CMD ["10"]