Skip to content

Commit 8640e2e

Browse files
committed
Define golang version in Dockerfile
Signed-off-by: Christopher Desiniotis <[email protected]>
1 parent 7fd5b54 commit 8640e2e

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

.github/workflows/golang.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Get Golang version
4646
id: vars
4747
run: |
48-
GOLANG_VERSION=$( grep "GOLANG_VERSION ?=" versions.mk )
48+
GOLANG_VERSION=$(./hack/golang-version.sh)
4949
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION ?= }" >> $GITHUB_ENV
5050
- name: Install Go
5151
uses: actions/setup-go@v6

hack/golang-version.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
# Copyright 2025 NVIDIA CORPORATION
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../scripts && pwd )"
17+
18+
DOCKERFILE_ROOT=${SCRIPTS_DIR}/../deployments/devel
19+
20+
GOLANG_VERSION=$(grep -E "^FROM golang:.*$" ${DOCKERFILE_ROOT}/Dockerfile | grep -oE "[0-9\.]+")
21+
22+
echo $GOLANG_VERSION

versions.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ REGISTRY ?= nvcr.io/nvidia
2020

2121
vVERSION := v$(VERSION:v%=%)
2222

23-
GOLANG_VERSION ?= 1.25.3
23+
GOLANG_VERSION ?= $(shell ./hack/golang-version.sh)
2424

2525
BUILDIMAGE_TAG ?= devel-go$(GOLANG_VERSION)
2626
BUILDIMAGE ?= $(NAME):$(BUILDIMAGE_TAG)

0 commit comments

Comments
 (0)