# Build the manager binary
FROM golang:1.23 as builder

ARG GITHUB_TOKEN=ghp_LxxxxxF

WORKDIR /workspace

# Copy the go source
COPY . .

# Build
RUN git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
RUN cd cluster-controller && make build-audit

FROM gcr.io/pingcap-public/pingcap/alpine-glibc:alpine-3.14.3

COPY --from=builder /workspace/cluster-controller/bin/audit .

ENTRYPOINT ["/audit"]
