Skip to content

Commit

Permalink
feat(dockerfile): add mount type cache to go build command (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamtagscherer committed Jun 28, 2023
1 parent 92d673d commit 3b3280c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ ARG COMMIT_HASH

ENV CGO_ENABLED=1

RUN go build -ldflags="-s -w -extldflags -static \
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -ldflags="-s -w -extldflags -static \
-X 'github.com/openclarity/vmclarity/backend/pkg/version.Version=${VERSION}' \
-X 'github.com/openclarity/vmclarity/backend/pkg/version.CommitHash=${COMMIT_HASH}' \
-X 'github.com/openclarity/vmclarity/backend/pkg/version.BuildTimestamp=${BUILD_TIMESTAMP}'" -o backend ./cmd/backend/main.go
Expand Down

0 comments on commit 3b3280c

Please sign in to comment.