-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
1 parent
688596b
commit 08dc80c
Showing
3 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
FROM ubuntu:22.04 | ||
|
||
# Use bash instead of sh | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Ensure no prompting while installing apt packages | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install standard tools required for building go-nvml | ||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
wget \ | ||
make \ | ||
git \ | ||
jq \ | ||
python3 \ | ||
libpython3-dev \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 1 | ||
|
||
# Install the spatch tool for semantic patching of C code | ||
RUN apt-get update && apt-get install -y \ | ||
coccinelle \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ARG TARGETARCH=amd64 | ||
ARG GOLANG_VERSION=0.0.0 | ||
|
||
# Install golang | ||
ENV ARCH=${TARGETARCH} | ||
RUN ARCH=${ARCH/x86_64/amd64} && ARCH=${ARCH/aarch64/arm64} && \ | ||
curl https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz \ | ||
| tar -C /usr/local -xz | ||
ENV GOPATH /go | ||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH | ||
|
||
# Get the supported version of c-for-go. Here we force the use of `GO111MODULE` for go get | ||
# to support the @VERSION syntax. | ||
ARG C_FOR_GO_TAG=main | ||
RUN go get github.com/xlab/c-for-go@${C_FOR_GO_TAG} | ||
RUN go install golang.org/x/lint/golint@latest | ||
RUN go install github.com/matryer/moq@latest | ||
|
||
# Install the golangci-lint tool | ||
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION} | ||
|
||
# Set the permissions on the go module path to ensure that this is accessible from | ||
# our user containers. | ||
RUN chmod -R a+rx /go/pkg/mod | ||
|
||
ENV JQ=jq | ||
|
||
# We need to set the /work directory as a safe directory. | ||
# This allows git commands to run in the container. | ||
RUN git config --file=/.gitconfig --add safe.directory /work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters