-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.driver
28 lines (20 loc) · 831 Bytes
/
Dockerfile.driver
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
FROM registry.access.redhat.com/ubi8/go-toolset:1.21 AS builder
WORKDIR /go/src/github.com/trustyai-explainability/trustyai-service-operator
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY cmd/ cmd/
COPY api/ api/
COPY controllers/ controllers/
# Copy license
COPY LICENSE /licenses/ta-lmes-driver.md
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -tags netgo -ldflags '-extldflags "-static"' -o /bin/driver ./cmd/lmes_driver/*.go
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
COPY --from=builder /bin/driver /bin/driver
USER 65532:65532
WORKDIR /bin
ENTRYPOINT [ "/bin/driver" ]