-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile.daemonset-ocp
49 lines (36 loc) · 1.35 KB
/
Dockerfile.daemonset-ocp
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.22 AS build
WORKDIR /workspace
# Copy the go source
COPY . .
# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
RUN go build -o bin/daemonset cmd/daemonset/main.go
FROM nvcr.io/nvidia/cuda:12.6.2-base-ubi9
ENV NVIDIA_DISABLE_REQUIRE="true"
ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
WORKDIR /
COPY --from=build /workspace/bin/daemonset .
# non-root user
# USER 65532:65532
ENTRYPOINT ["/daemonset"]
ARG NAME=instaslice-daemonset
ARG DESCRIPTION="The Instaslice daemonset."
LABEL com.redhat.component=$NAME
LABEL description=$DESCRIPTION
LABEL io.k8s.description=$DESCRIPTION
LABEL io.k8s.display-name=$NAME
LABEL name=$NAME
LABEL summary=$DESCRIPTION
LABEL distribution-scope=public
LABEL release="1"
LABEL url="https://access.redhat.com/"
LABEL vendor="Red Hat, Inc."
LABEL version="1"
LABEL maintainer="Red Hat"
LABEL io.openshift.tags=""
# Licenses
COPY LICENSE /licenses/LICENSE