Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Go 1.20.2 image
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
ArangoGutierrez committed Jan 30, 2024
1 parent 688596b commit 08dc80c
Showing 3 changed files with 57 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -28,11 +28,12 @@ jobs:
matrix:
go-version:
- "1.21"
- "1.21.4"
- "1.21.5"
- "1.20"
- "1.20.2"
- "1.20.4"
- "1.20.5"
- "1.21.4"
steps:
- name: Checkout
uses: actions/checkout@v4
55 changes: 55 additions & 0 deletions images/devel/cgo/Dockerfile
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
1 change: 0 additions & 1 deletion images/devel/Dockerfile → images/devel/go/Dockerfile
Original file line number Diff line number Diff line change
@@ -28,4 +28,3 @@ RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LI
# 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

0 comments on commit 08dc80c

Please sign in to comment.