1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# docker-build workload — multi-stage build against a digest-pinned base.
#
# The base is pinned to the exact alpine:3.20 digest rickub itself pins for its
# own CI images (images/firecracker/rootfs/Dockerfile in the rickub monorepo),
# i.e. a digest known to be stable and public. CAVEAT (documented in README):
# `apk add` inside the builder still floats with the Alpine mirror at run time;
# a truly bit-frozen build would vendored-package the toolchain, which would
# remove the network component this workload deliberately measures.
# syntax=docker/dockerfile:1
ARG ALPINE_IMAGE=alpine:3.20@sha256:d9e853e87e55526f6b2917df91a2115c36dd7c696a35be12163d44e6e2a4b6bc
# --- builder: fetch toolchain, compile --------------------------------------
FROM ${ALPINE_IMAGE} AS builder
RUN apk add --no-cache build-base
WORKDIR /src
COPY main.c .
RUN cc -O2 -static -o ci-bench-docker main.c
# --- final: tiny image, just the static binary ------------------------------
FROM ${ALPINE_IMAGE}
WORKDIR /
COPY --from=builder /src/ci-bench-docker /usr/local/bin/ci-bench-docker
# Expected output: ci-bench-docker-a56ee6092483
CMD ["/usr/local/bin/ci-bench-docker"]
|