# Build inside Alpine so the binary does not depend on the host Nix store. FROM alpine:latest AS build RUN apk add --no-cache build-base curl-dev ncurses-dev pkgconf python3 \ linux-headers WORKDIR /src COPY . . # Drop any host objects that slipped past .dockerignore (Nix glibc ≠ musl). RUN make clean && make -j"$(nproc)" cst-agent FROM alpine:latest RUN apk add --no-cache libcurl ncurses-libs ca-certificates COPY --from=build /src/cst-agent /usr/local/bin/cst-agent ENV XDG_CONFIG_HOME=/realm-config WORKDIR /work ENTRYPOINT ["cst-agent"]