FROM alpine:3.22.5 AS builder

RUN apk add --no-cache build-base

WORKDIR /src
COPY hello.c .

RUN mkdir -p /out \
    && cc -O2 -Wall -Wextra -Werror -static hello.c -o /out/hello

FROM scratch

COPY --from=builder /out/hello /hello

ENTRYPOINT ["/hello"]
