Skip to content

Commit

Permalink
During build step install go using wget in the target base image to m…
Browse files Browse the repository at this point in the history
…atch glibc versions

Signed-off-by: Christopher Desiniotis <[email protected]>
  • Loading branch information
cdesiniotis committed Jul 21, 2023
1 parent 0410023 commit 6db9eca
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions Dockerfile.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,36 @@

ARG BASE_DIST=ubi8
ARG CUDA_VERSION
ARG GOLANG_VERSION
ARG GOLANG_VERSION=x.x.x
ARG VERSION="N/A"

FROM golang:${GOLANG_VERSION} as builder
FROM nvcr.io/nvidia/cuda:${CUDA_VERSION}-base-${BASE_DIST} as build

RUN yum install -y wget make git gcc

ARG GOLANG_VERSION=0.0.0
RUN set -eux; \
\
arch="$(uname -m)"; \
case "${arch##*-}" in \
x86_64 | amd64) ARCH='amd64' ;; \
ppc64el | ppc64le) ARCH='ppc64le' ;; \
aarch64) ARCH='arm64' ;; \
*) echo "unsupported architecture" ; exit 1 ;; \
esac; \
wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz \
| tar -C /usr/local -xz

ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH

WORKDIR /build
# Copy the go source
COPY . .
# Build
RUN make cmds GO_BUILD_ENV='GOOS=linux GOARCH=${TARGETARCH}'
RUN GOOS=linux make cmd-k8s-kata-manager

FROM nvcr.io/nvidia/cuda:${CUDA_VERSION}-base-${BASE_DIST}
COPY --from=builder /build/bin/k8s-kata-manager /usr/local/bin/k8s-kata-manager
COPY --from=builder /build/bin/kata-manager /usr/local/bin/kata-manager

COPY --from=build /build/bin/k8s-kata-manager /usr/local/bin/k8s-kata-manager

RUN dnf install -y kmod

Expand Down

0 comments on commit 6db9eca

Please sign in to comment.