Compare commits

...

6 Commits
main ... main

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