forked from opendatahub-io/kserve
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent.Dockerfile
More file actions
30 lines (23 loc) · 804 Bytes
/
agent.Dockerfile
File metadata and controls
30 lines (23 loc) · 804 Bytes
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
29
30
# Build the inference-agent binary
FROM registry.access.redhat.com/ubi8/go-toolset:1.22 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
USER root
RUN CGO_ENABLED=0 GOOS=linux GOFLAGS=-mod=mod go build -a -o agent ./cmd/agent
# Copy the inference-agent into a thin image
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
RUN microdnf install -y --disablerepo=* --enablerepo=ubi-8-baseos-rpms shadow-utils && \
microdnf clean all && \
useradd kserve -m -u 1000
RUN microdnf remove -y shadow-utils
COPY third_party/ third_party/
WORKDIR /ko-app
COPY --from=builder /go/src/github.com/kserve/kserve/agent /ko-app/
USER 1000:1000
ENTRYPOINT ["/ko-app/agent"]