mirror of
https://github.com/anchore/syft.git
synced 2026-11-05 00:46:38 +01:00
add relationships for go binary packages (#2912)
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
FROM --platform=linux/amd64 golang:1.22 AS builder
|
||||
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY main.go main.go
|
||||
|
||||
# building with "." vs "main.go" is a difference in the buildinfo section
|
||||
# specifically with main.go the buildinfo section will contain the following:
|
||||
#
|
||||
# path command-line-arguments
|
||||
#
|
||||
# instead of
|
||||
#
|
||||
# mod anchore.io/not/real
|
||||
#
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o run-me main.go
|
||||
|
||||
|
||||
FROM scratch
|
||||
|
||||
COPY --from=builder /app/run-me /run-me
|
||||
ENTRYPOINT ["/run-me"]
|
||||
Reference in New Issue
Block a user