20 lines
527 B
Docker
20 lines
527 B
Docker
# syntax=docker/dockerfile:1
|
|
|
|
############################
|
|
# 1) Builder: compilen
|
|
############################
|
|
FROM alpine:3.20 AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Build-Tools nur im Builder
|
|
RUN apk add --no-cache build-base
|
|
|
|
# Nur die C-Datei kopieren (kleinerer Build-Context / besserer Cache)
|
|
COPY deployment.c .
|
|
|
|
# Kompilieren (statisch linken -> runtime braucht keine libc)
|
|
RUN gcc -O2 -static -s -o deployment deployment.c
|
|
|
|
ENTRYPOINT ["/bin/bash", "-c"]
|
|
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"] |