Skip to content

Commit 2caff21

Browse files
authored
govulncheck: use golang:1.23 as a base image (#163)
go toolchain will not downgrade the version of Go before scanning the contents :/ also, use `golang:1.24.0` as a builder image and let Go updates itself to the exact version specified in `go.mod` :) Signed-off-by: Xavier Coulon <[email protected]>
1 parent bcdba76 commit 2caff21

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

govulncheck-action/Containerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24 as builder
1+
FROM golang:1.24.0 as builder
22

33
ARG GOOS=linux
44
ARG GOARCH=amd64
@@ -7,14 +7,15 @@ WORKDIR /usr/src/app/
77

88
COPY . .
99

10+
ENV GOTOOLCHAIN=auto
11+
1012
RUN echo "Building govulncheckx binary for $GOOS/$GOARCH"
1113
RUN GOOS=$GOOS GOARCH=$GOARCH go build -v -o govulncheckx main.go
1214

13-
FROM golang:1.24
15+
FROM golang:1.23.0
1416
# using a fresh golang image without the `WORKDIR` from the builder stage
1517
# see https://docs.github.com/en/actions/reference/workflows-and-actions/dockerfile-support#workdir
16-
# using golang 1.24 but the entrypoint will trigger an install of the actual go version,
17-
# even if it is 1.23
18+
# using golang 1.23.0 since most of our projects are still using it (and toolchain will not downgrade the version of go)
1819

1920
# copy the binary from the builder stage
2021
COPY --from=builder /usr/src/app/govulncheckx /usr/local/bin/govulncheckx

0 commit comments

Comments
 (0)