Compare commits

...

6 Commits
main ... main

2 changed files with 12 additions and 14 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

View File

@ -1,22 +1,20 @@
# Base-Image # syntax=docker/dockerfile:1
FROM ubuntu:latest
# Pakete installieren ############################
RUN apt-get update # 1) Builder: compilen
RUN apt-get install -y build-essential gcc curl vim net-tools ############################
FROM alpine:3.20 AS builder
# Arbeitsverzeichnis setzen
WORKDIR /app WORKDIR /app
# alles kopieren # Build-Tools nur im Builder
COPY . . RUN apk add --no-cache build-base
# Code kompilieren # Nur die C-Datei kopieren (kleinerer Build-Context / besserer Cache)
RUN gcc -o deployment deployment.c COPY deployment.c .
# Verzeichnis für Ausgabe anlegen # Kompilieren (statisch linken -> runtime braucht keine libc)
RUN mkdir /output RUN gcc -O2 -static -s -o deployment deployment.c
# Ausgabe wird ins Container-Dateisystem geschrieben
ENTRYPOINT ["/bin/bash", "-c"] ENTRYPOINT ["/bin/bash", "-c"]
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"] CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]