Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hfingler opened this issue Oct 22, 2024 · 3 comments
Open

Comments

@hfingler
Copy link

hfingler commented Oct 22, 2024

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

@elezar
Copy link
Member

elezar commented Oct 31, 2024

@hfingler I have created #1030 to address this.

For completeness, what docker build command are you using?

@hfingler
Copy link
Author

hfingler commented Oct 31, 2024

I used Option 3 of Building and Running Locally, in the main readme:

docker build \
    -t nvcr.io/nvidia/k8s-device-plugin:devel \
    -f deployments/container/Dockerfile.ubuntu \
    .

@elezar
Copy link
Member

elezar commented Oct 31, 2024

Thanks. Note that you should be able to run:

make -f deployments/container/Makefile build

to build the image instead.

I will update our README with these instruction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants