Skip to content

Commit

Permalink
make: report docker platform with --version (#70)
Browse files Browse the repository at this point in the history
this is required for base metrics too
  • Loading branch information
mmetc authored Sep 23, 2024
1 parent c126af5 commit 513ce74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR /go/src/cs-aws-waf-bouncer
RUN apk add --update --no-cache make git
COPY . .

RUN make build
RUN make build DOCKER_BUILD=1

FROM alpine:latest
COPY --from=build /go/src/cs-aws-waf-bouncer/crowdsec-aws-waf-bouncer /crowdsec-aws-waf-bouncer
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ LD_OPTS_VARS=\
-X 'github.com/crowdsecurity/go-cs-lib/version.BuildDate=$(BUILD_TIMESTAMP)' \
-X 'github.com/crowdsecurity/go-cs-lib/version.Tag=$(BUILD_TAG)'

ifneq (,$(DOCKER_BUILD))
LD_OPTS_VARS += -X 'github.com/crowdsecurity/go-cs-lib/version.System=docker'
endif

export CGO_ENABLED=0
export LD_OPTS=-ldflags "-s -extldflags '-static' $(LD_OPTS_VARS)" \
-trimpath -tags netgo
Expand Down

0 comments on commit 513ce74

Please sign in to comment.