Skip to content

Commit

Permalink
fix: change compile option
Browse files Browse the repository at this point in the history
Signed-off-by: Kohei Morita <[email protected]>
  • Loading branch information
mrtc0 committed Mar 23, 2022
1 parent 8a9c938 commit 4a3de21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ before:
- go generate ./...
builds:
- env:
- CGO_ENABLED=1
goos:
- linux
goarch:
- amd64
tags:
- netgo
ldflags:
- -w -s -X main.version={{.Version}}
- -w -s -extldflags "-static" -X main.version={{.Version}}
main: ./cmd/bouheki
binary: bouheki
archives:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ test/integration/specify: bpf-restricted-network bpf-restricted-file bpf-restric

.PHONY: release/local
release/local: build build/docker
CGO_CFLAGS="-I$(abspath $(OUTPUT))" CGO_LDFLAGS="-Wl,-Bstatic -Wl,-Bdynamic,-lelf,-lz $(LIBBPF_OBJ)" goreleaser release --snapshot --rm-dist
CGO_CFLAGS="-I$(abspath $(OUTPUT))" CGO_LDFLAGS="-lelf -lz $(LIBBPF_OBJ)" goreleaser release --snapshot --rm-dist

.PHONY: release
release: build build/docker
CGO_CFLAGS="-I$(abspath $(OUTPUT))" CGO_LDFLAGS="-Wl,-Bstatic -Wl,-Bdynamic,-lelf,-lz $(LIBBPF_OBJ)" goreleaser release --rm-dist
CGO_CFLAGS="-I$(abspath $(OUTPUT))" CGO_LDFLAGS="-lelf -lz $(LIBBPF_OBJ)" goreleaser release --rm-dist
sudo docker push ghcr.io/mrtc0/bouheki:latest

0 comments on commit 4a3de21

Please sign in to comment.