forked from opendatahub-io/kserve
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocalmodel-agent.Dockerfile
More file actions
28 lines (22 loc) · 1.04 KB
/
localmodel-agent.Dockerfile
File metadata and controls
28 lines (22 loc) · 1.04 KB
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
26
27
28
# Build the manager binary
FROM registry.access.redhat.com/ubi9/go-toolset:1.25 as builder
# Copy in the go src
WORKDIR /go/src/github.com/kserve/kserve
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY cmd/ cmd/
COPY pkg/ pkg/
# Build
RUN CGO_ENABLED=0 GOOS=linux go build -a -o localmodelnode-agent ./cmd/localmodelnode
# Generate third-party licenses
COPY LICENSE LICENSE
RUN go install github.com/google/go-licenses@latest
# Forbidden Licenses: https://github.com/google/licenseclassifier/blob/e6a9bb99b5a6f71d5a34336b8245e305f5430f99/license_type.go#L341
RUN /opt/app-root/src/go/bin/go-licenses check ./cmd/... ./pkg/... --disallowed_types="forbidden,unknown"
RUN /opt/app-root/src/go/bin/go-licenses save --save_path third_party/library ./cmd/localmodelnode
# Copy the controller-manager into a thin image
FROM gcr.io/distroless/static:nonroot
COPY --from=builder /go/src/github.com/kserve/kserve/third_party /third_party
COPY --from=builder /go/src/github.com/kserve/kserve/localmodelnode-agent /manager
ENTRYPOINT ["/manager"]