k8s-device-plugin icon indicating copy to clipboard operation
k8s-device-plugin copied to clipboard

Wrong go version download on v0.16.2 Dockerfile causes error on build

Open hfingler opened this issue 4 months ago • 0 comments

I'm sorry if this was already reported, but I couldn't find anything on it. In this file: https://github.com/NVIDIA/k8s-device-plugin/blob/v0.16.2/deployments/container/Dockerfile.ubuntu

ARG GOLANG_VERSION=1.20.5
FROM nvidia/cuda:12.5.1-base-ubuntu22.04 as build

RUN apt-get update && \
    apt-get install -y wget make git gcc \
    && \
    rm -rf /var/lib/apt/lists/*

ARG GOLANG_VERSION=x.x.x
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

GOLANG_VERSION is being defined twice, and the second one overrides the first. On docker build, a 404 is thrown, as expected.

0.152 + uname -m
0.153 + arch=x86_64
0.153 + ARCH=amd64
0.153 + wget -nv -O - https://storage.googleapis.com/golang/gox.x.x.linux-amd64.tar.gz
0.153 + tar -C /usr/local -xz
0.266 https://storage.googleapis.com/golang/gox.x.x.linux-amd64.tar.gz:
0.266 2024-10-22 18:50:23 ERROR 404: Not Found.
0.267
0.267 gzip: stdin: unexpected end of file
0.267 tar: Child returned status 1
0.267 tar: Error is not recoverable: exiting now

I was able to build it by setting both to ARG GOLANG_VERSION=1.23.2

hfingler avatar Oct 22 '24 18:10 hfingler