Skip to content

Commit b38146c

Browse files
committed
Support building container image on aarch64 (arm64)
Signed-off-by: Dr. Jan-Philip Gehrcke <[email protected]>
1 parent 6d40928 commit b38146c

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

deployments/container/Dockerfile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,25 @@
1414

1515
ARG GOLANG_VERSION=1.23.8
1616
# We use an ubuntu20.04 base image to allow for a more efficient multi-arch builds.
17-
FROM --platform=${BUILDOS}/amd64 nvcr.io/nvidia/cuda:12.8.1-base-ubuntu20.04 AS build
17+
FROM nvcr.io/nvidia/cuda:12.8.1-base-ubuntu20.04 AS build
1818

1919
RUN apt-get update && \
2020
apt-get install -y wget make git gcc-aarch64-linux-gnu gcc \
2121
&& \
2222
rm -rf /var/lib/apt/lists/*
2323

2424
ARG GOLANG_VERSION=x.x.x
25-
RUN wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz \
25+
26+
RUN set -eux; \
27+
\
28+
arch="$(uname -m)"; \
29+
case "${arch##*-}" in \
30+
x86_64 | amd64) ARCH='amd64' ;; \
31+
ppc64el | ppc64le) ARCH='ppc64le' ;; \
32+
aarch64) ARCH='arm64' ;; \
33+
*) echo "unsupported architecture" ; exit 1 ;; \
34+
esac; \
35+
wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz \
2636
| tar -C /usr/local -xz
2737

2838
ENV GOPATH /go
@@ -59,8 +69,8 @@ LABEL com.nvidia.git-commit="${GIT_COMMIT}"
5969
LABEL release="N/A"
6070
LABEL summary="NVIDIA DRA Driver for GPUs"
6171
LABEL description="NVIDIA DRA Driver for GPUs"
62-
LABEL org.opencontainers.image.description "NVIDIA DRA Driver for GPUs"
63-
LABEL org.opencontainers.image.source "https://github.com/NVIDIA/k8s-dra-driver-gpu"
72+
LABEL org.opencontainers.image.description="NVIDIA DRA Driver for GPUs"
73+
LABEL org.opencontainers.image.source="https://github.com/NVIDIA/k8s-dra-driver-gpu"
6474

6575
RUN mkdir /licenses && mv /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-LICENSE
6676

0 commit comments

Comments
 (0)