|
| 1 | +# Copyright (c) NVIDIA CORPORATION. All rights reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +ARG GOLANG_VERSION=x.x.x |
| 16 | +ARG VERSION="N/A" |
| 17 | + |
| 18 | +FROM nvcr.io/nvidia/cuda:12.9.1-base-ubi9 as build |
| 19 | + |
| 20 | +RUN yum install -y wget make git gcc |
| 21 | + |
| 22 | +ARG GOLANG_VERSION=0.0.0 |
| 23 | +RUN set -eux; \ |
| 24 | + \ |
| 25 | + arch="$(uname -m)"; \ |
| 26 | + case "${arch##*-}" in \ |
| 27 | + x86_64 | amd64) ARCH='amd64' ;; \ |
| 28 | + ppc64el | ppc64le) ARCH='ppc64le' ;; \ |
| 29 | + aarch64 | arm64) ARCH='arm64' ;; \ |
| 30 | + *) echo "unsupported architecture" ; exit 1 ;; \ |
| 31 | + esac; \ |
| 32 | + wget -nv -O - https://go.dev/dl/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz \ |
| 33 | + | tar -C /usr/local -xz |
| 34 | + |
| 35 | +ENV GOPATH /go |
| 36 | +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH |
| 37 | + |
| 38 | +WORKDIR /build |
| 39 | +COPY . . |
| 40 | + |
| 41 | +RUN mkdir /artifacts |
| 42 | +ARG VERSION="N/A" |
| 43 | +ARG GIT_COMMIT="unknown" |
| 44 | +RUN make PREFIX=/artifacts cmds |
| 45 | + |
| 46 | +FROM nvcr.io/nvidia/distroless/go:v3.2.1-dev |
| 47 | + |
| 48 | +USER 0:0 |
| 49 | + |
| 50 | +SHELL ["/busybox/sh", "-c"] |
| 51 | +RUN ln -s /busybox/sh /bin/sh |
| 52 | +COPY --from=build /artifacts/k8s-kata-manager /usr/bin/k8s-kata-manager |
| 53 | + |
| 54 | +LABEL version="${VERSION}" |
| 55 | +LABEL release="N/A" |
| 56 | +LABEL vendor="NVIDIA" |
| 57 | +LABEL io.k8s.display-name="NVIDIA Kata Manager for Kubernetes" |
| 58 | +LABEL name="NVIDIA Kata Manager for Kubernetes" |
| 59 | +LABEL summary="NVIDIA Kata Manager for Kubernetes" |
| 60 | +LABEL description="See summary" |
| 61 | + |
| 62 | +ENTRYPOINT [ "/usr/bin/k8s-kata-manager" ] |
0 commit comments