# lab-caps:1, the capabilities lesson's test image: capsh/getpcaps from libcap-utils, a tiny Go program that
# prints its user IDs and capability sets, and a second copy of it with the setuid bit (owned by root).
FROM golang:1.27-alpine@sha256:b8c9b82affbbb82a020bbcf998dad2ba9516944ac7e883524642a481a9505e9c AS build
WORKDIR /src
COPY whoami.go .
RUN CGO_ENABLED=0 go build -o /out/lab-whoami whoami.go

FROM alpine:3.24
RUN apk add --no-cache libcap-utils
COPY --from=build /out/lab-whoami /usr/local/bin/lab-whoami
COPY --from=build /out/lab-whoami /usr/local/bin/lab-suid-whoami
RUN chmod 4755 /usr/local/bin/lab-suid-whoami
USER 10001:10001
