Skip to content

Error Building App with go-nvml lib in Container #137

@peacewang017

Description

@peacewang017

My app's target platform is Ubuntu 18.04, therefore I tried to build the app in a container.

my container:

FROM ubuntu:18.04

RUN unset http_proxy \
    && unset https_proxy \
    && unset HTTP_PROXY \
    && unset HTTPS_PROXY
RUN apt-get update \
    && apt-get install -y \
    git \
    curl \
    wget \
    python3 \
    python3-yaml \
    && apt-get clean

RUN wget https://go.dev/dl/go1.23.2.linux-amd64.tar.gz
RUN rm -rf /usr/local/go \
    && tar -C /usr/local -xzf go1.23.2.linux-amd64.tar.gz \
    && rm -rf go1.23.2.linux-amd64.tar.gz

ENV PATH="/usr/local/go/bin:${PATH}"
ENV PYTHONIOENCODING=utf-8

CMD ["bash"]

and when I try to compile it, there's something wrong, here is the error-log:

Image

at first I thought there's something wrong with the go-mod-cache, so in the container I check the file .cache/gomodcache/github.com/!n!v!i!d!i!a/go-nvml@v0.12.4-0/pkg/nvml/zz_generated.api.go (reported in the error-log).

unlike the error-log said, type Return is defined:

Image


Outside the container, I tried to build the app with the same code, and everything is OK.


Why is this happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions