Skip to content

Commit 9760ffb

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

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

deployments/container/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@
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 \
26-
| tar -C /usr/local -xz
25+
26+
# Support building on Linux on aarch64 (arm64) and on x86_64 (amd64).
27+
RUN _ARCH="arm64"; if [ "$(uname -m)" = "x86_64" ]; then _ARCH="amd64"; fi; \
28+
wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${_ARCH}.tar.gz \
29+
| tar -C /usr/local -xz
2730

2831
ENV GOPATH /go
2932
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
@@ -59,8 +62,8 @@ LABEL com.nvidia.git-commit="${GIT_COMMIT}"
5962
LABEL release="N/A"
6063
LABEL summary="NVIDIA DRA Driver for GPUs"
6164
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"
65+
LABEL org.opencontainers.image.description="NVIDIA DRA Driver for GPUs"
66+
LABEL org.opencontainers.image.source="https://github.com/NVIDIA/k8s-dra-driver-gpu"
6467

6568
RUN mkdir /licenses && mv /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-LICENSE
6669

0 commit comments

Comments
 (0)