forked from moby/buildkit
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request moby#5199 from crazy-max/govulncheck
govulncheck to report known vulnerabilities
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 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
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,23 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG GO_VERSION="1.22" | ||
ARG GOVULNCHECK_VERSION="v1.1.3" | ||
ARG FORMAT="text" | ||
|
||
FROM golang:${GO_VERSION}-alpine AS base | ||
WORKDIR /go/src/github.com/moby/buildkit | ||
ARG GOVULNCHECK_VERSION | ||
RUN --mount=type=cache,target=/root/.cache \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
go install golang.org/x/vuln/cmd/govulncheck@$GOVULNCHECK_VERSION | ||
|
||
FROM base AS run | ||
ARG FORMAT | ||
RUN --mount=type=bind,target=. <<EOT | ||
set -ex | ||
mkdir /out | ||
govulncheck -format ${FORMAT} ./... | tee /out/govulncheck.out | ||
EOT | ||
|
||
FROM scratch AS output | ||
COPY --from=run /out / |