Skip to content

Commit

Permalink
make: report docker platform with --version (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored Sep 23, 2024
1 parent 978eebd commit 06ca81c
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-cloudflare-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-cloudflare-bouncer/crowdsec-cloudflare-bouncer /usr/local/bin/crowdsec-cloudflare-bouncer
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,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 06ca81c

Please sign in to comment.