sigs.k8s.io/kueue@v0.6.2/Dockerfile (about)

     1  ARG BUILDER_IMAGE
     2  ARG BASE_IMAGE
     3  # Build the manager binary
     4  FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE} as builder
     5  
     6  ARG CGO_ENABLED
     7  ARG TARGETARCH
     8  
     9  WORKDIR /workspace
    10  # Copy the Go Modules manifests
    11  COPY go.mod go.mod
    12  COPY go.sum go.sum
    13  # cache deps before building and copying source so that we don't need to re-download as much
    14  # and so that source changes don't invalidate our downloaded layer
    15  RUN go mod download
    16  
    17  # Copy the go source
    18  COPY . .
    19  
    20  # Build
    21  RUN make build GO_BUILD_ENV='CGO_ENABLED=${CGO_ENABLED} GOOS=linux GOARCH=${TARGETARCH}'
    22  
    23  FROM --platform=${BUILDPLATFORM} ${BASE_IMAGE}
    24  WORKDIR /
    25  COPY --from=builder /workspace/bin/manager .
    26  USER 65532:65532
    27  
    28  ENTRYPOINT ["/manager"]