forked from freudenreichan/EinfuehrungInDocker_Pipeline2
17 lines
420 B
Docker
17 lines
420 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 |